我使用 PHPMailer 和 smtp2go 构建了一个简单的功能,我可以发送电子邮件,现在我如何对电子邮件进行分析,获取发送的电子邮件和打开的电子邮件,退回邮件?
我的功能是:
require("PHPMailer-master/class.phpmailer.php");
// path to the PHPMailer class.
function sendmail(){
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = "smtp";
$mail->Host = "smtpcorp.com";
//Enter your SMTP2GO account's SMTP server.
$mail->Port = "2525";
// 8025, 587 and 25 can also be used. Use Port 465 for SSL.
$mail->SMTPAuth = true;
//$mail->SMTPSecure = 'ssl';
// Uncomment this line if you want to use SSL.
$mail->Username = "";
$mail->Password = "";
$mail->From = "";
$mail->FromName = "";
$mail->AddAddress("", "Rachel Recipient");
$mail->AddReplyTo("", "Sender's Name");
$mail->Subject = "Hi!";
$mail->Body = "Hi! How are you?";
$mail->WordWrap = 50;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
exit;
} else {
echo 'Message has been sent.';
}
}
sendmail();
问候,