使用PHPMailer删除在PHP邮件中邮寄的邮件

时间:2015-08-25 05:25:53

标签: php email phpmailer

我正在使用PHPMailer在我的Php程序中发送邮件。电子邮件工作正常,但它显示从地区邮寄地址邮件。如何隐藏这些邮件在PHPMailer中邮寄,也可以通过电子邮件从区域隐藏。

enter image description here

当我使用下面的php mail()函数时,会删除详细信息。但我怎样才能在PHPMailer中执行此操作

mail('info@example.com', 'Subj', "Message", $headers, '-freturn@yourdomain.com')

这是php邮件代码

<?php
require_once 'phpmailer/class.phpmailer.php';
$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
$body = "Heloooo";
try {
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
  $mail->AddAddress('to@example.com', 'John Doe');
  $mail->SetFrom('info@example.ae', 'Info');
  $mail->AddReplyTo('name@yourdomain.com', 'First Last');
  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  $mail->MsgHTML($body);
  $mail->Send();
  echo "Message Sent OK<p></p>\n";
} catch (phpmailerException $e) {
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}

?>

0 个答案:

没有答案