当前位置: 首页>>代码示例>>PHP>>正文


PHP phpmailer::AddReplyTo方法代码示例

本文整理汇总了PHP中phpmailer::AddReplyTo方法的典型用法代码示例。如果您正苦于以下问题:PHP phpmailer::AddReplyTo方法的具体用法?PHP phpmailer::AddReplyTo怎么用?PHP phpmailer::AddReplyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpmailer的用法示例。


在下文中一共展示了phpmailer::AddReplyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: email_to_user

/**
 * Send an email to a specified user
 *
 * @uses $CFG
 * @param user $user  A {@link $USER} object
 * @param user $from A {@link $USER} object
 * @param string $subject plain text subject line of the email
 * @param string $messagetext plain text version of the message
 * @param string $messagehtml complete html version of the message (optional)
 * @param string $attachment a file on the filesystem
 * @param string $attachname the name of the file (extension indicates MIME)
 * @param bool $usetrueaddress determines whether $from email address should
 *          be sent out. Will be overruled by user profile setting for maildisplay
 * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
 *          was blocked by user and "false" if there was another sort of error.
 */
function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '', $attachment = '', $attachname = '', $usetrueaddress = true, $replyto = '', $replytoname = '')
{
    global $CFG;
    $textlib = textlib_get_instance();
    include_once $CFG->libdir . '/phpmailer/class.phpmailer.php';
    if (empty($user) || empty($user->email)) {
        return false;
    }
    /*
    if (over_bounce_threshold($user)) {
        error_log("User $user->id (".fullname($user).") is over bounce threshold! Not sending.");
        return false;
    }
    */
    // this doesn't exist right now, we may bring it in later though.
    $mail = new phpmailer();
    $mail->Version = 'Elgg ';
    // mailer version (should have $CFG->version on here but we don't have it yet)
    $mail->PluginDir = $CFG->libdir . '/phpmailer/';
    // plugin directory (eg smtp plugin)
    $mail->CharSet = 'UTF-8';
    // everything is now uft8
    if (empty($CFG->smtphosts)) {
        $mail->IsMail();
        // use PHP mail() = sendmail
    } else {
        if ($CFG->smtphosts == 'qmail') {
            $mail->IsQmail();
            // use Qmail system
        } else {
            $mail->IsSMTP();
            // use SMTP directly
            if ($CFG->debug > 7) {
                echo '<pre>' . "\n";
                $mail->SMTPDebug = true;
            }
            $mail->Host = $CFG->smtphosts;
            // specify main and backup servers
            if ($CFG->smtpuser) {
                // Use SMTP authentication
                $mail->SMTPAuth = true;
                $mail->Username = $CFG->smtpuser;
                $mail->Password = $CFG->smtppass;
            }
        }
    }
    /* not here yet, leave it in just in case.
       // make up an email address for handling bounces
       if (!empty($CFG->handlebounces)) {
           $modargs = 'B'.base64_encode(pack('V',$user->ident)).substr(md5($user->email),0,16);
           $mail->Sender = generate_email_processing_address(0,$modargs);
       }
       else {
           $mail->Sender   =  $CFG->sysadminemail;
       }
       */
    $mail->Sender = $CFG->sysadminemail;
    // for elgg. delete if we change the above.
    // TODO add a preference for maildisplay
    if (is_string($from)) {
        // So we can pass whatever we want if there is need
        $mail->From = $CFG->noreplyaddress;
        $mail->FromName = $from;
    } else {
        if (empty($from)) {
            // make stuff up
            $mail->From = $CFG->sysadminemail;
            $mail->FromName = $CFG->sitename . ' ' . __gettext('Administrator');
        } else {
            if ($usetrueaddress and !empty($from->maildisplay)) {
                $mail->From = $from->email;
                $mail->FromName = $from->name;
            } else {
                $mail->From = $CFG->noreplyaddress;
                $mail->FromName = $from->name;
                if (empty($replyto)) {
                    $mail->AddReplyTo($CFG->noreplyaddress, __gettext('Do not reply'));
                }
            }
        }
    }
    if (!empty($replyto)) {
        $mail->AddReplyTo($replyto, $replytoname);
    }
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:101,代码来源:elgglib.php

示例2: phpmailer

 function __construct()
 {
     $mail = new phpmailer();
     $mail->IsSMTP();
     //$mail->IsMail();
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->SMTPSecure = "ssl";
     // sets the prefix to the servier
     $mail->Host = SMTP_HOST;
     // sets GMAIL as the SMTP server
     $mail->Port = SMTP_PORT;
     // set the SMTP port for the GMAIL server
     $mail->Username = SMTP_USERNAME;
     // GMAIL username
     $mail->Password = SMTP_PASSWORD;
     // GMAIL password
     $mail->AddReplyTo(EMAIL_FROM, "");
     $mail->From = EMAIL_FROM;
     $mail->FromName = EMAIL_FROM_NAME;
     $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
     // optional, comment out and test
     $mail->WordWrap = 50;
     // set word wrap
     $this->_mail = $mail;
 }
开发者ID:business-expert,项目名称:prnsc,代码行数:26,代码来源:email.php

示例3: sendQRmail

function sendQRmail($from, $to, $subject, $msg, $qrcodeImage, $cid, $name)
{
    include_once 'inc/class.phpmailer.php';
    $mail = new phpmailer();
    $mail->SMTPDebug = 0;
    // debugging: 1 = errors and messages, 2 = messages only, 0 = off
    $mail->IsSMTP();
    // Set mailer to use SMTP
    $mail->Host = 'mailhub.eait.uq.edu.au';
    // Specify server
    $mail->Port = 25;
    // Server port: 465 ssl OR  587 tls
    //$mail->SMTPSecure = 'tls';                       // Enable encryption, 'ssl' also accepted
    $mail->SMTPAuth = false;
    // Enable SMTP authentication
    $mail->Username = 's4329663@student.uq.edu.au';
    // SMTP username
    $mail->Password = 'hongzhe123999';
    // SMTP password
    $mail->SetFrom($from, 'QRappi');
    // Sender
    $mail->AddReplyTo($from, 'Support');
    // Set an alternative reply-to address
    $mail->AddAddress($to, 'User');
    // Set who the message is to be sent to
    $mail->Subject = $subject;
    // Set the subject line
    // Prepares message for html (see doc for details http://phpmailer.worxware.com/?pg=tutorial)
    $mail->MsgHTML($msg);
    // Add the image to the email as an inline element (i.e. not as an attachment)
    $mail->AddStringEmbeddedImage($qrcodeImage, $cid, $name);
    // Send the message, check for errors
    $ok = $mail->Send();
    return $ok;
}
开发者ID:Hongzhe,项目名称:DECO3801-PeerTech,代码行数:35,代码来源:mail.php

示例4: SendMail

function SendMail($email, $name, $subject, $message)
{
    global $sockethost, $smtpauth, $smtpauthuser, $smtpauthpass, $socketfrom, $socketfromname, $socketreply, $socketreplyname;
    include 'class.phpmailer.php';
    $mail = new phpmailer();
    $mail->IsSMTP();
    $mail->Host = $sockethost;
    if ($smtpauth == 'TRUE') {
        $mail->SMTPAuth = true;
        $mail->Username = $smtpauthuser;
        $mail->Password = $smtpauthpass;
    }
    if (isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->From = $email;
        $mail->FromName = $name;
        $mail->AddReplyTo($email, $name);
    } else {
        $mail->From = $socketfrom;
        $mail->FromName = $socketfromname;
        $mail->AddReplyTo($socketreply, $socketreplyname);
    }
    $mail->IsHTML(False);
    $mail->Body = $message;
    $mail->Subject = $subject;
    if (isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->AddAddress($socketfrom, $socketfromname);
    } else {
        $mail->AddAddress($email, $name);
    }
    if (!$mail->Send()) {
        return 'Error: ' . $mail->ErrorInfo;
    } else {
        return 'Email Sent.';
    }
    $mail->ClearAddresses();
}
开发者ID:paintballrefjosh,项目名称:php-nuke-support-ticket,代码行数:36,代码来源:functions.php

示例5: sendmail

 public function sendmail($from, $to, $subject, $body, $altbody = null, $options = null, $attachments = null, $html = false)
 {
     if (!is_array($from)) {
         $from = array($from, $from);
     }
     $mail = new phpmailer();
     $mail->PluginDir = 'M/lib/phpmailer/';
     if ($this->getConfig('smtp')) {
         $mail->isSMTP();
         $mail->Host = $this->getConfig('smtphost');
         if ($this->getConfig('smtpusername')) {
             $mail->SMTPAuth = true;
             $mail->Port = $this->getConfig('smtpport') ? $this->getConfig('smtpport') : 25;
             $mail->SMTPDebug = $this->smtpdebug;
             $mail->Username = $this->getConfig('smtpusername');
             $mail->Password = $this->getConfig('smtppassword');
         }
     }
     $mail->CharSet = $this->getConfig('encoding');
     $mail->AddAddress($to);
     $mail->Subject = $subject;
     $mail->Body = $note . $body;
     $mail->AltBody = $altbody;
     if (!is_array($from)) {
         $from = array($from, $from);
     }
     $mail->From = $from[0];
     $mail->FromName = $from[1];
     if (key_exists('reply-to', $options)) {
         $mail->AddReplyTo($options['reply-to']);
         unset($options['reply-to']);
     }
     if (key_exists('Sender', $options)) {
         $mail->Sender = $options['Sender'];
     }
     if (null != $attachments) {
         if (!is_array($attachments)) {
             $attachments = array($attachments);
         }
         foreach ($attachments as $k => $v) {
             if (!$mail->AddAttachment($v, basename($v))) {
                 trigger_error("Attachment {$v} could not be added");
             }
         }
     }
     $mail->IsHTML($html);
     $result = $mail->send();
 }
开发者ID:demental,项目名称:m,代码行数:48,代码来源:Phpmailer.php

示例6: enviar

 function enviar($arguntos)
 {
     # code...
     $mail = new phpmailer(true);
     // the true param means it will throw exceptions on errors, which we need to catch
     $mail->IsSMTP();
     // telling the class to use SMTP
     $mail->Host = Host;
     // SMTP server
     $mail->SMTPDebug = 0;
     // enables SMTP debug information (for testing)
     $mail->IsHTML(true);
     $mail->SMTPAuth = SMTPAuth;
     // enable SMTP authentication
     $mail->SMTPSecure = SMTPSecure;
     // sets the prefix to the servier
     $mail->Port = Port;
     // set the SMTP port for the GMAIL server
     $mail->Username = Username;
     // GMAIL username
     $mail->Password = Password;
     // GMAIL password
     $mail->AddAddress($arguntos['email'], $arguntos['nomebusca']);
     if (AddReplyTo != '') {
         $mail->AddReplyTo(AddReplyTo);
     }
     $mail->Subject = $arguntos['Subject'];
     $mail->From = SetFromEmail;
     $mail->FromName = SetFromNome;
     $mail->Body = $arguntos['conteudo'];
     // optional - MsgHTML will create an alternate automatically
     // $mail->MsgHTML($arguntos['conteudo']);
     if ($mail->Send()) {
         echo "<p>Mensagem enviada com Sucesso!!!!</p>\n";
     }
 }
开发者ID:tvieira,项目名称:homebank,代码行数:36,代码来源:old_enviaemail.php

示例7: updateOrder

 /**
  * Update the order status and send the confirmation mail
  * according to the settings
  *
  * The resulting javascript code displays a message box or
  * does some page redirect.
  * @param   integer   $order_id       The order ID
  * @return  string                    Javascript code
  * @static
  */
 static function updateOrder($order_id, $newStatus = 1)
 {
     global $_ARRAYLANG, $_CONFIG;
     $product_id = self::getOrderValue('order_product', $order_id);
     if (empty($product_id)) {
         return 'alert("' . $_ARRAYLANG['TXT_EGOV_ERROR_UPDATING_ORDER'] . '");' . "\n";
     }
     // Has this order been updated already?
     $orderStatus = self::GetOrderValue('order_state', $order_id);
     if ($orderStatus != 0) {
         // Do not resend mails!
         return '';
     }
     $arrFields = self::getOrderValues($order_id);
     $FormValue4Mail = '';
     $arrMatch = array();
     foreach ($arrFields as $name => $value) {
         // If the value matches a calendar date, prefix the string with
         // the day of the week
         if (preg_match('/^(\\d\\d?)\\.(\\d\\d?)\\.(\\d\\d\\d\\d)$/', $value, $arrMatch)) {
             // ISO-8601 numeric representation of the day of the week
             // 1 (for Monday) through 7 (for Sunday)
             $dotwNumber = date('N', mktime(1, 1, 1, $arrMatch[2], $arrMatch[1], $arrMatch[3]));
             $dotwName = $_ARRAYLANG['TXT_EGOV_DAYNAME_' . $dotwNumber];
             $value = "{$dotwName}, {$value}";
         }
         $FormValue4Mail .= html_entity_decode($name) . ': ' . html_entity_decode($value) . "\n";
     }
     // Bestelleingang-Benachrichtigung || Mail f�r den Administrator
     $recipient = self::GetProduktValue('product_target_email', $product_id);
     if (empty($recipient)) {
         $recipient = self::GetSettings('set_orderentry_recipient');
     }
     if (!empty($recipient)) {
         $SubjectText = str_replace('[[PRODUCT_NAME]]', html_entity_decode(self::GetProduktValue('product_name', $product_id)), self::GetSettings('set_orderentry_subject'));
         $SubjectText = html_entity_decode($SubjectText);
         $BodyText = str_replace('[[ORDER_VALUE]]', $FormValue4Mail, self::GetSettings('set_orderentry_email'));
         $BodyText = html_entity_decode($BodyText);
         $replyAddress = self::GetEmailAdress($order_id);
         if (empty($replyAddress)) {
             $replyAddress = self::GetSettings('set_orderentry_sender');
         }
         if (@(include_once ASCMS_LIBRARY_PATH . '/phpmailer/class.phpmailer.php')) {
             $objMail = new \phpmailer();
             if (!empty($_CONFIG['coreSmtpServer'])) {
                 if (($arrSmtp = \SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer'])) !== false) {
                     $objMail->IsSMTP();
                     $objMail->Host = $arrSmtp['hostname'];
                     $objMail->Port = $arrSmtp['port'];
                     $objMail->SMTPAuth = true;
                     $objMail->Username = $arrSmtp['username'];
                     $objMail->Password = $arrSmtp['password'];
                 }
             }
             $objMail->CharSet = CONTREXX_CHARSET;
             $from = self::GetSettings('set_orderentry_sender');
             $fromName = self::GetSettings('set_orderentry_name');
             $objMail->AddReplyTo($replyAddress);
             $objMail->SetFrom($from, $fromName);
             $objMail->Subject = $SubjectText;
             $objMail->Priority = 3;
             $objMail->IsHTML(false);
             $objMail->Body = $BodyText;
             $objMail->AddAddress($recipient);
             $objMail->Send();
         }
     }
     // Update 29.10.2006 Statusmail automatisch abschicken || Produktdatei
     if (self::GetProduktValue('product_electro', $product_id) == 1 || self::GetProduktValue('product_autostatus', $product_id) == 1) {
         self::updateOrderStatus($order_id, $newStatus);
         $TargetMail = self::GetEmailAdress($order_id);
         if ($TargetMail != '') {
             $FromEmail = self::GetProduktValue('product_sender_email', $product_id);
             if ($FromEmail == '') {
                 $FromEmail = self::GetSettings('set_sender_email');
             }
             $FromName = self::GetProduktValue('product_sender_name', $product_id);
             if ($FromName == '') {
                 $FromName = self::GetSettings('set_sender_name');
             }
             $SubjectDB = self::GetProduktValue('product_target_subject', $product_id);
             if ($SubjectDB == '') {
                 $SubjectDB = self::GetSettings('set_state_subject');
             }
             $SubjectText = str_replace('[[PRODUCT_NAME]]', html_entity_decode(self::GetProduktValue('product_name', $product_id)), $SubjectDB);
             $SubjectText = html_entity_decode($SubjectText);
             $BodyDB = self::GetProduktValue('product_target_body', $product_id);
             if ($BodyDB == '') {
                 $BodyDB = self::GetSettings('set_state_email');
             }
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Egov.class.php

示例8: email_to_user

/**
 * Send an email to a specified user
 *
 * @uses $CFG
 * @uses $FULLME
 * @uses SITEID
 * @param user $user  A {@link $USER} object
 * @param user $from A {@link $USER} object
 * @param string $subject plain text subject line of the email
 * @param string $messagetext plain text version of the message
 * @param string $messagehtml complete html version of the message (optional)
 * @param string $attachment a file on the filesystem, relative to $CFG->dataroot
 * @param string $attachname the name of the file (extension indicates MIME)
 * @param bool $usetrueaddress determines whether $from email address should
 *          be sent out. Will be overruled by user profile setting for maildisplay
 * @return bool|string Returns "true" if mail was sent OK, "emailstop" if email
 *          was blocked by user and "false" if there was another sort of error.
 */
function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '', $attachment = '', $attachname = '', $usetrueaddress = true, $replyto = '', $replytoname = '')
{
    global $CFG, $FULLME;
    include_once $CFG->libdir . '/phpmailer/class.phpmailer.php';
    /// We are going to use textlib services here
    $textlib = textlib_get_instance();
    if (empty($user)) {
        return false;
    }
    // skip mail to suspended users
    if (isset($user->auth) && $user->auth == 'nologin') {
        return true;
    }
    if (!empty($user->emailstop)) {
        return 'emailstop';
    }
    if (over_bounce_threshold($user)) {
        error_log("User {$user->id} (" . fullname($user) . ") is over bounce threshold! Not sending.");
        return false;
    }
    $mail = new phpmailer();
    $mail->Version = 'Moodle ' . $CFG->version;
    // mailer version
    $mail->PluginDir = $CFG->libdir . '/phpmailer/';
    // plugin directory (eg smtp plugin)
    $mail->CharSet = 'UTF-8';
    if ($CFG->smtphosts == 'qmail') {
        $mail->IsQmail();
        // use Qmail system
    } else {
        if (empty($CFG->smtphosts)) {
            $mail->IsMail();
            // use PHP mail() = sendmail
        } else {
            $mail->IsSMTP();
            // use SMTP directly
            if (!empty($CFG->debugsmtp)) {
                echo '<pre>' . "\n";
                $mail->SMTPDebug = true;
            }
            $mail->Host = $CFG->smtphosts;
            // specify main and backup servers
            if ($CFG->smtpuser) {
                // Use SMTP authentication
                $mail->SMTPAuth = true;
                $mail->Username = $CFG->smtpuser;
                $mail->Password = $CFG->smtppass;
            }
        }
    }
    $supportuser = generate_email_supportuser();
    // make up an email address for handling bounces
    if (!empty($CFG->handlebounces)) {
        $modargs = 'B' . base64_encode(pack('V', $user->id)) . substr(md5($user->email), 0, 16);
        $mail->Sender = generate_email_processing_address(0, $modargs);
    } else {
        $mail->Sender = $supportuser->email;
    }
    if (is_string($from)) {
        // So we can pass whatever we want if there is need
        $mail->From = $CFG->noreplyaddress;
        $mail->FromName = $from;
    } else {
        if ($usetrueaddress and $from->maildisplay) {
            $mail->From = $from->email;
            $mail->FromName = fullname($from);
        } else {
            $mail->From = $CFG->noreplyaddress;
            $mail->FromName = fullname($from);
            if (empty($replyto)) {
                $mail->AddReplyTo($CFG->noreplyaddress, get_string('noreplyname'));
            }
        }
    }
    if (!empty($replyto)) {
        $mail->AddReplyTo($replyto, $replytoname);
    }
    $mail->Subject = substr(stripslashes($subject), 0, 900);
    $mail->AddAddress($user->email, fullname($user));
    $mail->WordWrap = 79;
    // set word wrap
    if (!empty($from->customheaders)) {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:101,代码来源:moodlelib.php

示例9: sendMail

 function sendMail($entryId)
 {
     global $objDatabase, $_ARRAYLANG, $_CORELANG, $_CONFIG;
     //entrydata
     $objResult = $objDatabase->Execute("SELECT id, title, name, userid, email FROM " . DBPREFIX . "module_market WHERE id='" . contrexx_addslashes($entryId) . "' LIMIT 1");
     if ($objResult !== false) {
         while (!$objResult->EOF) {
             $entryMail = $objResult->fields['email'];
             $entryName = $objResult->fields['name'];
             $entryTitle = $objResult->fields['title'];
             $entryUserid = $objResult->fields['userid'];
             $objResult->MoveNext();
         }
     }
     //assesuserdata
     $objResult = $objDatabase->Execute("SELECT email, username FROM " . DBPREFIX . "access_users WHERE id='" . $entryUserid . "' LIMIT 1");
     if ($objResult !== false) {
         while (!$objResult->EOF) {
             // TODO: Never used
             //                $userMail            = $objResult->fields['email'];
             $userUsername = $objResult->fields['username'];
             $objResult->MoveNext();
         }
     }
     //get mail content n title
     $objResult = $objDatabase->Execute("SELECT title, content, active, mailcc FROM " . DBPREFIX . "module_market_mail WHERE id='1'");
     if ($objResult !== false) {
         while (!$objResult->EOF) {
             $mailTitle = $objResult->fields['title'];
             $mailContent = $objResult->fields['content'];
             $mailCC = $objResult->fields['mailcc'];
             $mailOn = $objResult->fields['active'];
             $objResult->MoveNext();
         }
     }
     if ($mailOn == 1) {
         $array = explode('; ', $mailCC);
         $url = $_SERVER['SERVER_NAME'] . ASCMS_PATH_OFFSET;
         $link = "http://" . $url . "/index.php?section=Market&cmd=detail&id=" . $entryId;
         $now = date(ASCMS_DATE_FORMAT);
         //replase placeholder
         $array_1 = array('[[EMAIL]]', '[[NAME]]', '[[TITLE]]', '[[ID]]', '[[LINK]]', '[[URL]]', '[[DATE]]', '[[USERNAME]]');
         $array_2 = array($entryMail, $entryName, $entryTitle, $entryId, $link, $url, $now, $userUsername);
         for ($x = 0; $x < 8; $x++) {
             $mailTitle = str_replace($array_1[$x], $array_2[$x], $mailTitle);
         }
         for ($x = 0; $x < 8; $x++) {
             $mailContent = str_replace($array_1[$x], $array_2[$x], $mailContent);
         }
         //create mail
         $to = $entryMail;
         $fromName = $_CONFIG['coreAdminName'] . " - " . $url;
         $fromMail = $_CONFIG['coreAdminEmail'];
         $subject = $mailTitle;
         $message = $mailContent;
         if (\Env::get('ClassLoader')->loadFile(ASCMS_LIBRARY_PATH . '/phpmailer/class.phpmailer.php')) {
             $objMail = new \phpmailer();
             if ($_CONFIG['coreSmtpServer'] > 0) {
                 if (($arrSmtp = \SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer'])) !== false) {
                     $objMail->IsSMTP();
                     $objMail->Host = $arrSmtp['hostname'];
                     $objMail->Port = $arrSmtp['port'];
                     $objMail->SMTPAuth = true;
                     $objMail->Username = $arrSmtp['username'];
                     $objMail->Password = $arrSmtp['password'];
                 }
             }
             $objMail->CharSet = CONTREXX_CHARSET;
             $objMail->From = $fromMail;
             $objMail->FromName = $fromName;
             $objMail->AddReplyTo($fromMail);
             $objMail->Subject = $subject;
             $objMail->IsHTML(false);
             $objMail->Body = $message;
             $objMail->AddAddress($to);
             $objMail->Send();
             $objMail->ClearAddresses();
             foreach ($array as $toCC) {
                 // Email message
                 if (!empty($toCC)) {
                     $objMail->AddAddress($toCC);
                     $objMail->Send();
                     $objMail->ClearAddresses();
                 }
             }
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:88,代码来源:MarketLibrary.class.php

示例10: send_email

function send_email($to, $subject, $body, $from = '', $fromname = '', $stmp = true, $sender = '', $host = '', $port = '', $ssl = '', $username = '', $password = '')
{
    global $charset;
    $mail = new phpmailer();
    if (!$stmp) {
        $mail->IsMail();
    } else {
        $mail->IsSMTP();
        $mail->SMTPAuth = true;
        $mail->Host = $host;
        if ($ssl) {
            $mail->SMTPSecure = "ssl";
        }
        if ($port != '') {
            $mail->Port = $port;
        }
        $mail->Username = $username;
        $mail->Password = $password;
    }
    $mail->IsHTML(true);
    $mail->Sender = $sender;
    $mail->FromEmail = $from;
    $mail->FromName = $fromname;
    $mail->Subject = $subject;
    $mail->Body = $body;
    $mail->CharSet = $charset;
    $mail->WordWrap = 50;
    if (is_array($to)) {
        foreach ($to as $email) {
            $mail->AddAddress($email, "");
        }
    } else {
        $mail->AddAddress($to, "");
    }
    if ($fromname != '') {
        $mail->AddReplyTo($from, $fromname);
    }
    $mail->IsHTML(true);
    if (!$mail->Send()) {
        return "Mailer Error: " . $mail->ErrorInfo;
    } else {
        return true;
    }
}
开发者ID:saintho,项目名称:phpdisk,代码行数:44,代码来源:global.func.php

示例11: informAdminAboutRejectedMail

 /**
  * Inform the admin about a reject
  *
  * If an email could not be sent, inform the administrator
  * about that (only if the option to do so was set)
  * @author      Stefan Heinemann <sh@adfinis.com>
  * @param       int $newsletterID
  * @param       int $userID
  * @param       string $email
  * @param       const
  */
 protected function informAdminAboutRejectedMail($newsletterID, $userID, $email, $type)
 {
     // Get the current user's email address
     $addy = \FWUser::getFWUserObject()->objUser->getEmail();
     \Env::get('ClassLoader')->loadFile(ASCMS_LIBRARY_PATH . '/phpmailer/class.phpmailer.php');
     $mail = new \phpmailer();
     $newsletterValues = $this->getNewsletterValues($newsletterID);
     if ($newsletterValues['smtp_server'] > 0) {
         if (($arrSmtp = \SmtpSettings::getSmtpAccount($newsletterValues['smtp_server'])) !== false) {
             $mail->IsSMTP();
             $mail->Host = $arrSmtp['hostname'];
             $mail->Port = $arrSmtp['port'];
             $mail->SMTPAuth = $arrSmtp['username'] == '-' ? false : true;
             $mail->Username = $arrSmtp['username'];
             $mail->Password = $arrSmtp['password'];
         }
     }
     $mail->CharSet = CONTREXX_CHARSET;
     $mail->From = $newsletterValues['sender_email'];
     $mail->FromName = $newsletterValues['sender_name'];
     $mail->AddReplyTo($newsletterValues['return_path']);
     $mail->Subject = $newsletterValues['subject'];
     $mail->Priority = $newsletterValues['priority'];
     $mail->Body = $this->getInformMailBody($userID, $email, $type);
     $mail->AddAddress($addy);
     $mail->send();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:38,代码来源:NewsletterManager.class.php

示例12: sendMessage

 function sendMessage($id)
 {
     global $objDatabase, $_ARRAYLANG, $_CORELANG, $_CONFIG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     //get erntry
     $this->getEntries('', 'id', $id);
     if (isset($id) && count($this->entries) != 0) {
         //get search
         $this->getSearch();
         //get navigatin
         $this->getNavigation($this->entries[$id]['catid']);
         if ($_POST['title'] != '' && $_POST['message'] != '') {
             //create mail
             $sendTo = $this->entries[$id]['email'];
             $fromName = $_POST['name'];
             $fromMail = $_POST['email'];
             $subject = $_POST['title'];
             $newPrice = $_POST['newprice'] != '' ? "\n\n" . $_ARRAYLANG['TXT_PRICE_EXPECTATION'] . "\n" . $_POST['newprice'] : '';
             $oldPrice = $_POST['price'] != '' ? "\n\n" . $_ARRAYLANG['TXT_MARKET_MESSAGE_PRICE'] . "\n" . $_POST['price'] : '';
             $message = $_POST['message'] . $oldPrice . $newPrice;
             if (\Env::get('ClassLoader')->loadFile(ASCMS_LIBRARY_PATH . '/phpmailer/class.phpmailer.php')) {
                 $objMail = new \phpmailer();
                 if ($_CONFIG['coreSmtpServer'] > 0 && \Env::get('ClassLoader')->loadFile(ASCMS_CORE_PATH . '/SmtpSettings.class.php')) {
                     if (($arrSmtp = \SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer'])) !== false) {
                         $objMail->IsSMTP();
                         $objMail->Host = $arrSmtp['hostname'];
                         $objMail->Port = $arrSmtp['port'];
                         $objMail->SMTPAuth = true;
                         $objMail->Username = $arrSmtp['username'];
                         $objMail->Password = $arrSmtp['password'];
                     }
                 }
                 $objMail->CharSet = CONTREXX_CHARSET;
                 $objMail->From = $fromMail;
                 $objMail->FromName = $fromName;
                 $objMail->AddReplyTo($fromMail);
                 $objMail->Subject = $subject;
                 $objMail->IsHTML(false);
                 $objMail->Body = $message;
                 $objMail->AddAddress($sendTo);
                 $objMail->Send();
             }
             // set variables
             $this->_objTpl->setVariable(array('MARKET_TITLE' => $_ARRAYLANG['TXT_MARKET_MESSAGE_SUCCESS_TITLE'], 'MARKET_MSG_SEND' => $_ARRAYLANG['TXT_MARKET_MESSAGE_SUCCESS_BODY'], 'TXT_MARKET_BACK' => $_CORELANG['TXT_BACK']));
         }
     } else {
         \Cx\Core\Csrf\Controller\Csrf::header('Location: ?section=Market');
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:49,代码来源:Market.class.php

示例13: sendMail

 function sendMail()
 {
     global $_ARRAYLANG, $_CONFIG;
     if (\Env::get('ClassLoader')->loadFile(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseLibraryPath() . '/phpmailer/class.phpmailer.php')) {
         $objMail = new \phpmailer();
         if ($_CONFIG['coreSmtpServer'] > 0 && \Env::get('ClassLoader')->loadFile(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseCorePath() . '/SmtpSettings.class.php')) {
             $arrSmtp = \SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer']);
             if ($arrSmtp !== false) {
                 $objMail->IsSMTP();
                 $objMail->Host = $arrSmtp['hostname'];
                 $objMail->Port = $arrSmtp['port'];
                 $objMail->SMTPAuth = true;
                 $objMail->Username = $arrSmtp['username'];
                 $objMail->Password = $arrSmtp['password'];
             }
         }
         $objMail->CharSet = CONTREXX_CHARSET;
         $objMail->From = $_CONFIG['coreAdminEmail'];
         $objMail->FromName = $_CONFIG['coreGlobalPageTitle'];
         $objMail->AddReplyTo($_CONFIG['coreAdminEmail']);
         $objMail->Subject = $this->strTitle;
         $objMail->IsHTML(false);
         $objMail->Body = $this->strTemplate;
         foreach ($this->arrRecipients as $key => $strMailAdress) {
             if (!empty($strMailAdress)) {
                 $objMail->AddAddress($strMailAdress);
                 $objMail->Send();
                 $objMail->ClearAddresses();
             }
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:32,代码来源:MediaDirectoryMail.class.php

示例14: supportSendMail

function supportSendMail($email, $name, $subject, $message, $response_flag = false)
{
    global $sendmethod, $sockethost, $smtpauth, $smtpauthuser, $smtpauthpass, $socketfrom, $socketfromname, $socketreply, $socketreplyname;
    include_once 'class.phpmailer.php';
    $mail = new phpmailer();
    if (file_exists('class/language/phpmailer.lang-en.php')) {
        $mail->SetLanguage('en', 'class/language/');
    } else {
        $mail->SetLanguage('en', '../class/language/');
    }
    if (isset($sendmethod) && $sendmethod == 'sendmail') {
        $mail->IssupportSendMail();
    } elseif (isset($sendmethod) && $sendmethod == 'smtp') {
        $mail->IsSMTP();
    } elseif (isset($sendmethod) && $sendmethod == 'mail') {
        $mail->IsMail();
    } elseif (isset($sendmethod) && $sendmethod == 'qmail') {
        $mail->IsQmail();
    }
    $mail->Host = $sockethost;
    if ($smtpauth == 'TRUE') {
        $mail->SMTPAuth = true;
        $mail->Username = $smtpauthuser;
        $mail->Password = $smtpauthpass;
    }
    if (!$response_flag && isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->From = $email;
        $mail->FromName = $name;
        $mail->AddReplyTo($email, $name);
    } else {
        $mail->From = $socketfrom;
        $mail->FromName = $socketfromname;
        $mail->AddReplyTo($socketreply, $socketreplyname);
    }
    $mail->IsHTML(False);
    $mail->Body = $message;
    $mail->Subject = $subject;
    if (!$response_flag && isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->AddAddress($socketfrom, $socketfromname);
    } else {
        $mail->AddAddress($email, $name);
    }
    if (!$mail->Send()) {
        return 'Error: ' . $mail->ErrorInfo;
    } else {
        return 'Email Sent. ' . $mail->ErrorInfo;
    }
    $mail->ClearAddresses();
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:49,代码来源:functions.php

示例15: Send


//.........这里部分代码省略.........
     } else {
         $y = 1;
     }
     // si se deseára configurar los parametros de el dominio
     // y cuenta de correo default, aquí se recibirian los parámetros.
     $port = $this->port;
     $smtp_secure = $this->smtp_secure;
     $auth = $this->auth;
     $host = $this->host;
     $username = $this->username;
     $password = $this->password;
     $mail = new phpmailer();
     $mail->CharSet = 'UTF-8';
     $mail->Mailer = "smtp";
     $mail->IsSMTP();
     ini_set('max_execution_time', 600);
     $mail->SMTPAuth = true;
     // si se indica un puerto este se utilizara,
     // de lo contrario su usará el default.
     if (empty($port)) {
         $mail->Port = 465;
     } else {
         $mail->Port = $port;
     }
     // si se indica un tipo de seguridad este se utilizara,
     // de lo contrario su usará el default.
     if (empty($smtp_secure)) {
         $mail->SMTPSecure = 'ssl';
     } else {
         $mail->SMTPSecure = $smtp_secure;
     }
     // si se indica un cambio en la autenticación este se utilizara,
     // de lo contrario su usará el default.
     if (empty($auth)) {
         $mail->SMTPAuth = true;
     } else {
         $mail->SMTPAuth = $auth;
     }
     // si se indica un host este se utilizara,
     // de lo contrario su usará el default.
     if (empty($host)) {
         $mail->Host = "securemail.aplus.net";
     } else {
         $mail->Host = $host;
     }
     // si se indica un usuario este se utilizara,
     // de lo contrario su usará el default.
     if (empty($username)) {
         $mail->Username = "basededatos@globalcorporation.cc";
     } else {
         $mail->Username = $username;
     }
     // si se indica un password este se utilizara,
     // de lo contrario su usará el default.
     if (empty($password)) {
         $mail->Password = "kIU8a#4i";
     } else {
         $mail->Password = $password;
     }
     $mail->Subject = $subject;
     if ($def_from == 1) {
         $mail->SetFrom($from[1], $from[0]);
     } else {
         $mail->SetFrom('basededatos@globalcorporation.cc', 'Global Corporation');
     }
     if ($rp == 1) {
         $mail->AddReplyTo($replyto[1], $replyto[0]);
     }
     $mail->Body = " ";
     $mail->MsgHTML($body);
     if ($z == 2) {
         for ($a = 0; $a < count($attachment_r); $a++) {
             $mail->AddAttachment($attachment_r[$a], $attachment_t[$a]);
         }
     }
     if ($y == 2) {
         for ($a = 0; $a < count($embeddedimg_r); $a++) {
             $mail->AddEmbeddedImage($embeddedimg_r[$a], $embeddedimg_t[$a]);
         }
     }
     for ($i = 0; $i < count($to); $i++) {
         $a = $to[$i];
         $mail->AddAddress($a['direccion'], $a['nombre']);
     }
     for ($j = 0; $j < count($cc); $j++) {
         $a = $cc[$j];
         $mail->AddCC($a['direccion'], $a['nombre']);
     }
     for ($k = 0; $k < count($cco); $k++) {
         $a = $cco[$k];
         $mail->AddBCC($a['direccion'], $a['nombre']);
     }
     $mail->IsHTML(true);
     if ($mail->Send()) {
         return true;
     } else {
         $this->errors = "SEND_MAIL_ERROR " . $mail->ErrorInfo;
         return 0;
     }
 }
开发者ID:JesusHV,项目名称:restaurantes,代码行数:101,代码来源:Mailerclass.php


注:本文中的phpmailer::AddReplyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。