我正在使用php-mailer发送电子邮件。 邮件成功,然而在每封电子邮件中,我收到“邮件:gamil.com”并在邮件标题中签名:“gmail.com”。
如何从电子邮件中删除已邮寄和已签名的代码? 这是我的代码
require_once('././php_mailer/class.phpmailer.php');
$body = html($msg);
$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
try {
$mail->Host = 'smtp.gmail.com'; // SMTP server
$mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = 'smtp.gmail.com'; // sets the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = 'nabina.smartmobe@gmail.com'; // SMTP account username
$mail->Password = '******'; // SMTP account password
$mail->AddAddress($to, 'Nabina');
$mail->SetFrom('no-reply@nayacinema.com.np', 'no-reply@nayacinema.com.np');
$mail->AddReplyTo('no-reply@nayacinema.com.np', 'no-reply@nayacinema.com.np');
$mail->IsHTML(true);
$mail->Subject ='NayaCinema: '.$subject;
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($body);
if($attachment){
$mail->AddAttachment($attachment);
}
if($mail->Send()){
//echo 'sent'; die;
return true;
}else{
//echo ' not sent'; die;
return false;
}
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
谢谢