请找到以下代码。此代码驻留在mydomainname.com
中mail("mymail@gmail.com,mymail@mydomainname.com","Testing mail","This is a test mail.","From: mymail@yahoo.com\n");
和
mail("mymail@gmail.com,mymail@mydomainname.com","Testing mail","This is a test mail.","From: mymail@mydomainname.com\n");
我收到邮件到我的gmail帐户(或任何雅虎帐户)的两个代码,但我没有收到邮件到我的webmail或cPanel squirrelmail等。
我可以直接向此域名电子邮件帐户发送电子邮件
此域的邮件服务器是否会阻止来自同一域的邮件? 该代码早先用于相同的域名。 这是托管方面的问题吗?它是一个共享服务器。
答案 0 :(得分:0)
Try this
<?php
$to = "admin@gmail.com,mymail@gmail.com";
$subject = "Following Customer Signed Up";
$message = " $username,Customer is signed up with us,<br /><br />
Thanks <br />";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
// More headers
$headers .= 'From: <mymail@mydomainname.com>' . "\r\n";
$mail=mail($to,$subject,$message,$headers);
?>