小智 40
您必须添加针头:
示例代码:
$headers = "From: myplace@example.com\r\n";
$headers .= "Reply-To: myplace2@example.com\r\n";
$headers .= "Return-Path: myplace@example.com\r\n";
$headers .= "CC: sombodyelse@example.com\r\n";
$headers .= "BCC: hidden@example.com\r\n";
if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>
Run Code Online (Sandbox Code Playgroud)
Osw*_*ald 19
没有确定的射击技巧.您需要了解邮件被归类为垃圾邮件的原因.SpamAssassin有一个页面描述了合法发件人避免误报的一些技巧.另见Coding Horror:所以你想发送一些电子邮件(通过代码)
小智 6
<?php
$subject = "this is a subject";
$message = "testing a message";
$headers .= "Reply-To: The Sender <sender@domain.com>\r\n";
$headers .= "Return-Path: The Sender <sender@domain.com>\r\n";
$headers .= "From: The Sender <sender@domain.com>\r\n";
$headers .= "Organization: Sender Organization\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n" ;
mail("reciever@domain.com", $subject, $message, $headers);
?>
Run Code Online (Sandbox Code Playgroud)