المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ممكن دالة إرسال بريد إلكتروني تدعم from , to ,,



walid
11-01-2013, بتوقيت غرينيتش 09:25 AM
http://www.dzbatna.com/images/icons/iconrote.gif ظ…ظ…ظƒظ† ط¯ط§ظ„ط© ط¥ط±ط³ط§ظ„ ط¨ط±ظٹط¯ ط¥ظ„ظƒطھط±ظˆظ†ظٹ طھط¯ط¹ظ… from , to ,, (http://www.dzbatna.com/t478554/)




سلام عليكم

ممكن دالة إرسال بريد إلكتروني تدعم from , to ,,


لقيت هالسكريبت script

رمز PHP:

<code style="white-space:nowrap"> <code> <?php

////////////////////////////////////////////////////////////
// EmailClass 0.5
// class for sending mail
//
// Paul Schreiber
// [email protected] (http://www.cloudflare.com/email-protection)
// http://paulschreiber.com/
//
// parameters
// ----------
// - subject, message, senderName, senderEmail and toList are required
// - ccList, bccList and replyTo are optional
// - toList, ccList and bccList can be strings or arrays of strings
// (those strings should be valid email addresses
//
// example
// -------
// $m = new email ( "hello there", // subject
// "how are you?", // message body
// "paul", // sender's name
// "[email protected] (http://www.cloudflare.com/email-protection)", // sender's email
// array("[email protected] (http://www.cloudflare.com/email-protection)", "[email protected] (http://www.cloudflare.com/email-protection)"), // To: recipients
// "[email protected] (http://www.cloudflare.com/email-protection)" // Cc: recipient
// );
//
// print "mail sent, result was" . $m->send();
//
//
//

if ( ! defined( 'MAIL_CLASS_DEFINED' ) ) {
define('MAIL_CLASS_DEFINED', 1 );

class email {

// the constructor!
function email ( $subject, $message, $senderName, $senderEmail, $toList, $ccList=0, $bccList=0, $replyTo=0) {
$this->sender = $senderName . " <$senderEmail>";
$this->replyTo = $replyTo;
$this->subject = $subject;
$this->message = $message;

// set the To: recipient(s)
if ( is_array($toList) ) {
$this->to = join( $toList, "," );
} else {
$this->to = $toList;
}

// set the Cc: recipient(s)
if ( is_array($ccList) && sizeof($ccList) ) {
$this->cc = join( $ccList, "," );
} elseif ( $ccList ) {
$this->cc = $ccList;
}

// set the Bcc: recipient(s)
if ( is_array($bccList) && sizeof($bccList) ) {
$this->bcc = join( $bccList, "," );
} elseif ( $bccList ) {
$this->bcc = $bccList;
}

}

// send the message; this is actually just a wrapper for
// PHP's mail() function; heck, it's PHP's mail function done right :-)
// you could override this method to:
// (a) use sendmail directly
// (b) do SMTP with sockets
function send () {
// create the headers needed by PHP's mail() function

// sender
$this->headers = "From: " . $this->sender . "\n";

// reply-to address
if ( $this->replyTo ) {
$this->headers .= "Reply-To: " . $this->replyTo . "\n";
}

// Cc: recipient(s)



if ( $this->cc ) {
$this->headers .= "Cc: " . $this->cc . "\n";
}

// Bcc: recipient(s)
if ( $this->bcc ) {
$this->headers .= "Bcc: " . $this->bcc . "\n";
}

return mail ( $this->to, $this->subject, $this->message, $this->headers );
}
}


}
?> </code> </code>

بس ما عرفت أطلع الدالة منه معقد

يا ليت حد يساعدني

http://www.dzbatna.com/images/smilies/blushing.gif





ألعاب الأندرويد مجانا و حصريا (http://www.apotox.info/forum)




https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/482113_236967293114455_1193518507_n.png (http://www.dzbatna.com)
©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى (http://www.dzbatna.com)©

استعمل مربع البحث في الاسفل لمزيد من المواضيع


سريع للبحث عن مواضيع في المنتدى