PHP不是我的语言(c#),但我需要一个通过电子邮件回复的特定功能。
我必须在两个域上使用相同的简单脚本:
<?php
$to = "aaa@dom1.nl;aaa@dom2.nl";
$subject = "Test mail";
$message = "Hello! This is a simple test email message.";
$from = "aaa@dom3.nl";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
当从dom1启动脚本时,收到的唯一邮件是dom1而不是dom2。当它在dom2上启动时,只有dom2收到邮件。
我缺少什么?
感谢
网站提供商似乎只允许在域内发送php邮件....
答案 0 :(得分:0)
You should be using comma to separate emails:
以强>
邮件的接收者或接收者。
此字符串的格式必须符合» RFC 2822。一些 例子是:
user@example.com
user@example.com, anotheruser@example.com
User <user@example.com>
User <user@example.com>, Another User <anotheruser@example.com>