本文整理汇总了PHP中PHPMailer::AddReplyTo方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPMailer::AddReplyTo方法的具体用法?PHP PHPMailer::AddReplyTo怎么用?PHP PHPMailer::AddReplyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPMailer
的用法示例。
在下文中一共展示了PHPMailer::AddReplyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enviar
function enviar()
{
if ($this->cliente->getAccessToken()) {
$service = new Google_Service_Gmail($this->cliente);
try {
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->From = Contants::FROM;
$mail->FromName = Contants::ALIAS;
$mail->AddAddress($this->destino);
$mail->AddReplyTo(Contants::FROM, Contants::ALIAS);
$mail->Subject = $this->asunto;
$mail->Body = $this->mensaje;
$mail->preSend();
$mime = $mail->getSentMIMEMessage();
$mime = rtrim(strtr(base64_encode($mime), '+/', '-_'), '=');
$mensaje = new Google_Service_Gmail_Message();
$mensaje->setRaw($mime);
$service->users_messages->send('me', $mensaje);
$r = 1;
} catch (Exception $e) {
print $e->getMessage();
$r = 0;
}
} else {
$r = -1;
}
return $r;
}
示例2: array
function wpsight_mail_send_email($data = array(), $opts = array())
{
if (!class_exists('PHPMailer')) {
require ABSPATH . '/wp-includes/class-phpmailer.php';
}
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
foreach ($data['recipients'] as $addr) {
if (is_array($addr)) {
$mail->AddAddress($addr[0], $addr[1]);
} else {
$mail->AddAddress($addr);
}
}
$mail->Subject = isset($data['subject']) ? $data['subject'] : null;
if (is_array($data['body']) && isset($data['body']['html'])) {
$mail->isHTML(true);
$mail->Body = $data['body']['html'];
$mail->AltBody = isset($data['body']['text']) ? $data['body']['text'] : null;
}
$mail->From = $data['sender_email'];
$mail->FromName = $data['sender_name'];
if (isset($data['reply_to'])) {
foreach ((array) $data['reply_to'] as $addr) {
if (is_array($addr)) {
$mail->AddReplyTo($addr[0], $addr[1]);
} else {
$mail->AddReplyTo($addr);
}
}
}
if (isset($data['attachments']) && is_array($data['attachments'])) {
foreach ($data['attachments'] as $attachment) {
$encoding = isset($attachment['encoding']) ? $attachment['encoding'] : 'base64';
$type = isset($attachment['type']) ? $attachment['type'] : 'application/octet-stream';
$mail->AddStringAttachment($attachment['data'], $attachment['filename'], $encoding, $type);
}
}
if (isset($opts['transport']) && $opts['transport'] == 'smtp') {
$mail->isSMTP();
$mail->Host = $opts['smtp_host'];
$mail->Port = isset($opts['smtp_port']) ? (int) $opts['smtp_port'] : 25;
if (!empty($opts['smtp_user'])) {
$mail->Username = $opts['smtp_user'];
$mail->Password = $opts['smtp_pass'];
}
if (!empty($opts['smtp_sec'])) {
$mail->SMTPSecure = $opts['smtp_sec'];
}
}
do_action('wpsight_mail_pre_send', $mail, $data, $opts);
return $mail->send() ? true : $mail->ErrorInfo;
}
示例3: handle
public function handle($fromTitle, $fromMail, $toEmail, $subject, $body, $attachments, $smtpHost, $smtpPort, $serverLogin = '', $serverPassword = '', $charCode = 'UTF-8', $isHtml = false)
{
if (!is_object($this->_mail)) {
$this->_mail = new PHPMailer();
}
$this->_mail->CharSet = $charCode;
$this->_mail->IsHTML($isHtml);
$this->_mail->From = $fromMail;
$this->_mail->FromName = $fromTitle;
$this->_mail->AddReplyTo($fromMail, $fromTitle);
$this->_mail->Subject = $subject;
$this->_mail->Body = $body;
$this->_mail->AltBody = '';
$this->_mail->AddAddress($toEmail, '');
$this->_mail->IsSMTP(true);
$this->_mail->Mailer = 'smtp';
$this->_mail->Host = $smtpHost;
$this->_mail->Port = $smtpPort;
if ($serverLogin != '') {
$this->_mail->SMTPAuth = true;
$this->_mail->Username = $serverLogin;
$this->_mail->Password = $serverPassword;
} else {
$this->_mail->SMTPAuth = false;
$this->_mail->Username = '';
$this->_mail->Password = '';
}
if (is_object($attachments)) {
//FIXME
// // zalaczniki
//for ($z = 0; $z < Count($tab_mail_oma_zalacznik[$tab_mail_id[$i]]); $z++) {
//if (($tab_mail_oma_zalacznik[$tab_mail_id[$i]][$z] != '') AND (file_exists($tab_mail_oma_zalacznik[$tab_mail_id[$i]][$z]))) {
//if ($tab_mail_oma_zalacznik_cid[$tab_mail_id[$i]][$z] == '') {
//$this->_mail->AddAttachment($tab_mail_oma_zalacznik[$tab_mail_id[$i]][$z], basename($tab_mail_oma_zalacznik[$tab_mail_id[$i]][$z]));
//} // koniec if...
//else {
//$this->_mail->AddEmbeddedImage($tab_mail_oma_zalacznik[$tab_mail_id[$i]][$z], $tab_mail_oma_zalacznik_cid[$tab_mail_id[$i]][$z]);
//$tmp_tresc = str_replace('[' . $tab_mail_oma_zalacznik_cid[$tab_mail_id[$i]][$z] . ']', 'cid:' . $tab_mail_oma_zalacznik_cid[$tab_mail_id[$i]][$z], $tmp_tresc);
//} // koniec else...
//} // koniec if...
//} // koniec for...
}
if (!$this->_mail->Send()) {
$status = false;
} else {
$status = true;
}
$this->_mail->ClearAddresses();
$this->_mail->ClearAttachments();
return $status;
}
示例4: sendMail
function sendMail($correoUsuario, $correoCliente, $archivo)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = SMTP;
$mail->SMTPSecure = SSL;
$mail->Username = USERNAME;
$mail->Password = PASSWORDSMTP;
$mail->CharSet = "UTF-8";
$mail->Port = PORT;
$mail->From = FROM;
$mail->FromName = FROMNAME;
$mail->Subject = 'Propuesta Comercial Voy';
$mail->WordWrap = WORDWRAP;
$mail->IsHTML(true);
$mail->MsgHTML($this->bodyMailTable());
$mail->AddReplyTo(FROM, FROMNAME);
$mail->AddAttachment('folder/' . $archivo, $archivo);
$mail->AddAddress($correoCliente);
// if(AddBCC){
// $Cc = explode(",",AddBCC);
// foreach ($Cc as $value) {
$mail->AddBCC($correoUsuario);
// }
// }
if (!$mail->Send()) {
echo "Error de envío de email: " . $mail->ErrorInfo;
exit;
} else {
return;
}
}
示例5: smtpmail
function smtpmail($to, $subject, $content, $attach = false)
{
require_once 'config_app.php';
require_once 'phpmailer/class.phpmailer.php';
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = $__smtp['host'];
$mail->SMTPDebug = $__smtp['debug'];
$mail->SMTPAuth = $__smtp['auth'];
$mail->Host = $__smtp['host'];
$mail->Port = $__smtp['port'];
$mail->Username = $__smtp['username'];
$mail->Password = $__smtp['password'];
$mail->SetFrom($__smtp['addreply'], 'Mashkov Andrey');
$mail->AddReplyTo($__smtp['addreply'], $__smtp['username']);
$mail->AddAddress($to);
$mail->Subject = htmlspecialchars($subject);
$mail->CharSet = 'utf8';
$mail->MsgHTML($content);
if ($attach) {
$mail->AddAttachment($attach);
}
if (!$mail->Send()) {
$returner = "errorSend";
} else {
$returner = "okSend";
}
$mail->ClearAddresses();
$mail->ClearAttachments();
$mail->IsHTML(true);
return $returner;
}
示例6: send
public static function send($to, $subject, $content)
{
$__smtp = array("host" => "smtp.sxss.com.ua", "debug" => 0, "auth" => true, "port" => 25, "username" => "no-reply@sxss.com.ua", "password" => "oz7UQD1a", "addreply" => "no-reply@sxss.com.ua", "replyto" => "");
$mail = new PHPMailer(true);
$mail->IsSMTP();
try {
$mail->CharSet = 'utf-8';
$mail->Host = $__smtp['host'];
$mail->SMTPDebug = $__smtp['debug'];
$mail->SMTPAuth = $__smtp['auth'];
$mail->Host = $__smtp['host'];
$mail->Port = $__smtp['port'];
$mail->Username = $__smtp['username'];
$mail->Password = $__smtp['password'];
$mail->AddReplyTo($__smtp['username'], "ClickPay24");
$mail->AddAddress($to);
$mail->SetFrom($__smtp['username'], "ClickPay24");
$mail->AddReplyTo($__smtp['username'], "ClickPay24");
$mail->Subject = htmlspecialchars($subject);
$mail->MsgHTML($content);
$mail->Send();
} catch (phpmailerException $e) {
} catch (Exception $e) {
}
}
示例7: send_mail
function send_mail($to, $subject, $content, $addreply = null, $attach = false)
{
require_once 'config.php';
require_once 'class.phpmailer.php';
$mail = new PHPMailer(true);
$mail->IsSMTP();
try {
$mail->Host = $__smtp['host'];
$mail->SMTPDebug = $__smtp['debug'];
$mail->SMTPAuth = $__smtp['auth'];
$mail->Host = $__smtp['host'];
$mail->Port = $__smtp['port'];
$mail->Username = $__smtp['username'];
$mail->Password = $__smtp['password'];
$mail->AddAddress($to);
$mail->SetFrom($__smtp['username'], $__smtp['fromname']);
if (!empty($addreply)) {
$mail->AddReplyTo($addreply, $addreply);
} else {
$mail->AddReplyTo($__smtp['addreply'], $__smtp['fromname']);
}
$mail->Subject = htmlspecialchars($subject);
$mail->MsgHTML($content);
if ($attach) {
$mail->AddAttachment($attach);
}
return $mail->Send();
} catch (phpmailerException $e) {
//echo $e->errorMessage();
return false;
} catch (Exception $e) {
//echo $e->getMessage();
return false;
}
}
示例8: send
/**
* Short description of method send
*
* @access public
* @author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
* @return int
*/
public function send()
{
$returnValue = (int) 0;
foreach ($this->messages as $message) {
if ($message instanceof tao_helpers_transfert_Message) {
$this->mailer->SetFrom($message->getFrom());
$this->mailer->AddReplyTo($message->getFrom());
$this->mailer->Subject = $message->getTitle();
$this->mailer->AltBody = strip_tags(preg_replace("/<br.*>/i", "\n", $message->getBody()));
$this->mailer->MsgHTML($message->getBody());
$this->mailer->AddAddress($message->getTo());
try {
if ($this->mailer->Send()) {
$message->setStatus(tao_helpers_transfert_Message::STATUS_SENT);
$returnValue++;
}
if ($this->mailer->IsError()) {
if (DEBUG_MODE) {
echo $this->mailer->ErrorInfo . "<br>";
}
$message->setStatus(tao_helpers_transfert_Message::STATUS_ERROR);
}
} catch (phpmailerException $pe) {
if (DEBUG_MODE) {
print $pe;
}
}
}
$this->mailer->ClearReplyTos();
$this->mailer->ClearAllRecipients();
}
$this->mailer->SmtpClose();
return (int) $returnValue;
}
示例9: carregar
/**
* Método para carregar o objeto PHPMailer
* @return \PHPMailer
*/
public function carregar() {
$dados = \controlador\Facil::getDadosIni();
require(LIB . DS . "PHPMailer/class.phpmailer.php");
$this->mailer = new \PHPMailer();
if ($dados['email']['smtp']) {
$this->mailer->IsSMTP();
$this->mailer->Host = $dados['email']['host'];
$this->mailer->SMTPAuth = $dados['email']['autenticar'];
$this->mailer->Username = $dados['email']['usuario'];
$this->mailer->Password = $dados['email']['senha'];
}
$this->mailer->From = $dados['email']['from_email'];
$this->mailer->FromName = $dados['email']['from_nome'];
$this->mailer->IsHTML($dados['email']['html']);
$this->mailer->WordWrap = $dados['email']['wordwrap'];
$this->mailer->AddReplyTo($this->mailer->From);
$this->mailer->CharSet = $dados['l10n']['charset'];
return $this->mailer;
}
示例10: send
function send($o, $to, $from, $subject, $body, $headers)
{
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPDebug = 0;
// enables SMTP debug information (for testing)
$mail->SMTPAuth = $this->api->getConfig("tmail/phpmailer/username", null) ? true : false;
// enable SMTP authentication
$mail->Host = $this->api->getConfig("tmail/smtp/host");
$mail->Port = $this->api->getConfig("tmail/smtp/port");
$mail->Username = $this->api->getConfig("tmail/phpmailer/username", null);
$mail->Password = $this->api->getConfig("tmail/phpmailer/password", null);
$mail->SMTPSecure = 'tls';
$mail->AddReplyTo($this->api->getConfig("tmail/phpmailer/reply_to"), $this->api->getConfig("tmail/phpmailer/reply_to_name"));
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->MsgHTML($body);
$mail->AltBody = null;
$mail->IsHTML(true);
$bcc = $this->api->getConfig("tmail/phpmailer/bcc", null);
if ($bcc) {
$bcc_name = $this->api->getConfig("tmail/phpmailer/bcc_name", null);
$mail->AddBCC($bcc, $bcc_name);
}
$internal_header_map = array("Content-Type" => "ContentType");
$void_headers = array("MIME-Version");
$fromAdded = false;
foreach (explode("\n", $headers) as $h) {
if (preg_match("/^(.*?):(.*)\$/", $h, $t)) {
if (strtolower($t[1]) == "from" && $t[2]) {
$mail->SetFrom($t[2]);
$fromAdded = true;
continue;
}
if (isset($internal_header_map[$t[1]])) {
$key = $internal_header_map[$t[1]];
$mail->{$key} = $t[2];
continue;
} else {
if (in_array($t[1], $void_headers)) {
continue;
}
}
}
$mail->AddCustomHeader($h);
}
if (!$fromAdded) {
$mail->SetFrom($this->api->getConfig("tmail/phpmailer/from"), $from ? "" : $this->api->getConfig("tmail/phpmailer/from_name"));
$mail->AddReplyTo($this->api->getConfig("tmail/phpmailer/reply_to"), $this->api->getConfig("tmail/phpmailer/reply_to_name"));
}
$mail->Send();
}
示例11: setUp
/**
* Run before each test is started.
*/
function setUp()
{
if (file_exists('./testbootstrap.php')) {
include './testbootstrap.php';
//Overrides go in here
}
require_once $this->INCLUDE_DIR . 'class.phpmailer.php';
$this->Mail = new PHPMailer();
$this->Mail->Priority = 3;
$this->Mail->Encoding = "8bit";
$this->Mail->CharSet = "iso-8859-1";
if (array_key_exists('mail_from', $_REQUEST)) {
$this->Mail->From = $_REQUEST['mail_from'];
} else {
$this->Mail->From = 'unit_test@phpmailer.example.com';
}
$this->Mail->FromName = "Unit Tester";
$this->Mail->Sender = "";
$this->Mail->Subject = "Unit Test";
$this->Mail->Body = "";
$this->Mail->AltBody = "";
$this->Mail->WordWrap = 0;
if (array_key_exists('mail_host', $_REQUEST)) {
$this->Mail->Host = $_REQUEST['mail_host'];
} else {
$this->Mail->Host = 'mail.example.com';
}
if (array_key_exists('mail_port', $_REQUEST)) {
$this->Mail->Port = $_REQUEST['mail_port'];
} else {
$this->Mail->Port = 25;
}
$this->Mail->Helo = "localhost.localdomain";
$this->Mail->SMTPAuth = false;
$this->Mail->Username = "";
$this->Mail->Password = "";
$this->Mail->PluginDir = $this->INCLUDE_DIR;
$this->Mail->AddReplyTo("no_reply@phpmailer.example.com", "Reply Guy");
$this->Mail->Sender = "unit_test@phpmailer.example.com";
if (strlen($this->Mail->Host) > 0) {
$this->Mail->Mailer = "smtp";
} else {
$this->Mail->Mailer = "mail";
$this->Mail->Sender = "unit_test@phpmailer.example.com";
}
if (array_key_exists('mail_to', $_REQUEST)) {
$this->SetAddress($_REQUEST['mail_to'], 'Test User', 'to');
}
if (array_key_exists('mail_cc', $_REQUEST) and strlen($_REQUEST['mail_cc']) > 0) {
$this->SetAddress($_REQUEST['mail_cc'], 'Carbon User', 'cc');
}
}
示例12: Send_Mail
function Send_Mail($to, $subject, $body)
{
require 'class.phpmailer.php';
$from = "from@email.com";
$mail = new PHPMailer();
$mail->IsSMTP(true);
// SMTP
$mail->SMTPAuth = true;
// SMTP authentication
$mail->Mailer = "smtp";
$mail->Host = "tls://smtp.gmail.com";
// Amazon SES server, note "tls://" protocol
$mail->Port = 465;
// set the SMTP port
$mail->Username = "sushantjadhav2010@gmail.com";
// SES SMTP username
$mail->Password = "9096098525";
// SES SMTP password
$mail->SetFrom($from, 'ENQUIP');
$mail->AddReplyTo($from, 'sushantjadhav2010');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
if (!$mail->Send()) {
return false;
} else {
return true;
}
}
示例13: login
public function login()
{
$uid = $this->session->user->id;
$token = md5(date('Ymd') . $this->session->user->id . $this->session->user->login . $this->session->user->login . 'HAHAAHAVOACABARCOMISSOJAJA');
$v = new Views();
$v->username = $this->session->user->login;
$v->link = HOST . "meu-perfil/redes-sociais/nerdtrack/callback/?uid={$uid}&token={$token}";
$message = $v->render('mail/nerdtrack-link-account.phtml');
Phalanx::loadExtension('phpmailer');
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail_status = true;
try {
$mail->AddReplyTo(MAIL_FROM, MAIL_ALIAS);
$mail->AddAddress($this->post->email_address, $this->session->user->login);
$mail->Subject = 'SkyNerd: Vínculo de conta da Nerdtrack';
$mail->MsgHTML($message);
$mail->Send();
} catch (phpmailerException $e) {
$mail_status = false;
}
header("Content-type: text/html; charset=utf-8");
if ($mail_status) {
Phalanx::loadClasses('SocialNetwork');
SocialNetwork::link_account($this->session->user->id, NERDTRACK, $this->post->email_address, false);
die('SUCCESS');
} else {
die('FAIL');
}
}
示例14: Sendemail
function Sendemail($to, $subject, $message, $repyto, $from, $fromname)
{
try {
$mail = new PHPMailer(true);
//New instance, with exceptions enabled
$mail->IsSMTP();
// tell the class to use SMTP
$mail->SMTPAuth = false;
// enable SMTP authentication
$mail->IsSendmail();
// tell the class to use Sendmail
$mail->AddReplyTo($repyto, $fromname);
$mail->From = $from;
$mail->FromName = $fromname;
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
// optional, comment out and test
$mail->WordWrap = 80;
// set word wrap
$mail->MsgHTML($message);
$mail->IsHTML(true);
// send as HTML
$mail->Send();
return true;
} catch (phpmailerException $e) {
//echo $e->errorMessage();
}
}
示例15: send
/**
* @param $data
* @return bool|string
* @throws Exception
* @throws phpmailerException
*/
public static function send($data)
{
$mail = new PHPMailer();
if (cfg()->is_smtp) {
$mail->IsSMTP();
// set mailer to use SMTP
}
$mail->Host = cfg()->smtp_host;
$mail->Port = cfg()->smtp_port;
$mail->SMTPAuth = cfg()->smtp_auth;
// turn on SMTP authentication
$mail->Username = cfg()->mail_user;
// SMTP username
$mail->Password = cfg()->mail_password;
// SMTP password
$mail->From = $data['from_email'];
$mail->FromName = $data['from_name'];
$mail->AddAddress($data['to_mail']);
$mail->SetFrom($data['from_email'], $data['from_name']);
$mail->AddReplyTo($data['from_email'], $data['from_name']);
//$mail->SMTPDebug = 10;
//$mail->SMTPSecure = 'tls';
$mail->WordWrap = cfg()->mail_world_warp;
// set word wrap to 50 characters
$mail->IsHTML(cfg()->is_html);
// set email format to HTML
$mail->Subject = $data['subject'];
$mail->Body = $data['message_html'];
if (!$mail->Send()) {
return $mail->ErrorInfo;
}
return true;
}