尝试使用 mail()
功能发送一些邮件$passage_ligne = "\r\n";
$boundary = "-----=".md5(rand());
$headers = 'From:'.$nom.' <'.$email.'>' . "\r\n";
$headers .= 'Return-Path: '.$nom.' <'.$email.'>'.$passage_ligne;
$headers .= "Message-ID:<".time()." TheSystem@".$_SERVER['SERVER_NAME'].">".$passage_ligne;
$headers .= "X-Mailer: PHP v".phpversion().$passage_ligne;
$headers.= "MIME-Version: 1.0".$passage_ligne;
$headers.= "Content-Type: multipart/related; boundary=\"$boundary\"".$passage_ligne;
if(file_exists($file))
{
$file_type = filetype($file);
$file_size = filesize($file);
$handle = fopen($file, 'r') or die('File '.$file.'can t be open');
$content = fread($handle, $file_size);
$content = chunk_split(base64_encode($content));
$f = fclose($handle);
$corps = '--'.$boundary."\r\n";
$corps .= 'Content-type:'.$file_type.';name='.$file."\r\n";
$corps .= 'Content-transfer-encoding:base64'."\r\n";
$corps .= "Content-Disposition: attachment; filename='".$file."'\r\n";
$corps .= $content."\r\n";
}
在未送达的讯息中,它说:
找不到主机或域名。 name = xxx-xxx.com type = A:找不到主机
的名称服务错误
看不出有什么不对吗?