我目前有一个php脚本,用于使用sendmail从Ubuntu服务器发送电子邮件。
$to = $sendTo;
$subject = $subjectPrefix . $subject;
$txt = $message;
$headers = array(
"From: ". $email,
"Reply-To: ".$email,
"Content-type:text/html;charset=UTF-8",
"MIME-Version: 1.0",
"X-Mailer: PHP/" . PHP_VERSION
);
$headers = implode("\r\n", $headers);
if(mail($to,$subject,$txt,$headers)){
echo "sent";
}
else {
echo "failed";
}
电子邮件可以正常发送,但始终会成为垃圾邮件,并在电子邮件上附加服务器地址,例如:"input@email.com"@ip-###-##-##-###.eu -west-2.compute.internal
我该如何将其设置为仅显示输入的电子邮件而不进入垃圾邮件?