php邮件函数仅在域地址上发送邮件

php邮件函数仅在域地址上发送邮件,php,email,Php,Email,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;

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邮件….

一个或多个邮件接收人

此字符串的格式必须符合。一些 例如:

  • user@example.com
  • user@example.com, anotheruser@example.com
  • 用户
  • 用户,另一个用户

我已经试过了,但是没有收到电子邮件。。