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


PHP mailer::AddReplyTo方法代码示例

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


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

示例1: html

 function html($to, $toName, $from, $fromName, $subject, $body)
 {
     $mail = new mailer();
     if (defined('mail_from')) {
         $mail->From = mail_from;
         $mail->AddReplyTo($from, $fromName);
     } else {
         $mail->From = $from;
     }
     $mail->FromName = $fromName;
     $mail->IsHTML(true);
     $mail->Subject = $subject;
     $mail->Body = $body;
     switch (gettype($to)) {
         case 'string':
             $mail->AddAddress($to, $toName);
             break;
         case 'array':
             foreach ($to as $toKey => $thisTo) {
                 $mail->AddAddress($thisTo, $toName[$toKey]);
             }
             break;
         default:
             trigger_error('invalid type for address field');
     }
     if (!$mail->Send()) {
         trigger_error("Message could not be sent. Mailer Error: " . $mail->ErrorInfo);
     }
 }
开发者ID:laiello,项目名称:zoop,代码行数:29,代码来源:Mail.php

示例2: exec

 public function exec($data)
 {
     $response_array = array();
     $name = ucwords($data['name']);
     $email = $data['email'];
     $phone = $data['phone'] != "" ? $data['phone'] : "-";
     $message = $data['message'];
     //        NOTIFY RECEIVER BY EMAIL
     //        Generate Email BODY
     $html = file_get_contents(BASE_PATH . 'email_template/contact');
     $html = htmlspecialchars($html);
     $html = str_replace('[NAME]', $name, $html);
     $html = str_replace('[EMAIL]', $email, $html);
     $html = str_replace('[PHONE]', $phone, $html);
     $html = str_replace('[MESSAGE]', $message, $html);
     $html = html_entity_decode($html);
     $body = $html;
     //        Send Email
     $mailer = new mailer();
     $mailer->IsSMTP();
     // set mailer to use SMTP
     $mailer->Port = EMAIL_PORT;
     $mailer->Host = EMAIL_HOST;
     // specify main and backup server
     $mailer->SMTPAuth = true;
     // turn on SMTP authentication
     $mailer->Username = NOREPLY_EMAIL;
     // SMTP username
     $mailer->Password = NOREPLY_PASS;
     // SMTP password
     $mailer->From = NOREPLY_EMAIL;
     $mailer->FromName = SUPPORT_NAME;
     $mailer->AddReplyTo($email, $name);
     $mailer->AddAddress(CONTACT_EMAIL);
     $mailer->IsHTML(true);
     $mailer->Subject = "NEW message from {$email} via 1STG Contact Form.";
     $mailer->Body = $body;
     if (!$mailer->Send()) {
         $response_array['r'] = "false";
         $response_array['msg'] = "Technical Error: " . $mailer->ErrorInfo;
     } else {
         $response_array['r'] = "true";
         $response_array['msg'] = "Your message has been successfully submit.";
     }
     return $response_array;
 }
开发者ID:kronxblue,项目名称:1stg,代码行数:46,代码来源:contact_model.php


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