PHP mail()无法发送电子邮件,没有页面错误。 SMTP

时间:2016-10-06 16:16:41

标签: php smtp iis-6

以下是一个基本代码块,应该在登陆页面的人发送电子邮件。当我访问该页面时,我得到零错误,但是电子邮件永远不会到达我的收件箱。任何帮助将不胜感激,因为我觉得它与我的SMTP服务器是远程的。

ini_set('SMTP','myServer');
ini_set('smtp_port',25); 
If (isset($_GET["email"])) {
    $email = $_GET['email'];  
    $to = 'group1@myOrg.org';
    $subject='Internal Password scam';
    $message = "$email clicked on the link and landed on the page.";
    $headers = 'From: donotreply@myOrg.org' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);

其他一些资料─ server:win64 2008 R2 Ent(Sp1)

1 个答案:

答案 0 :(得分:-1)

For my particular problem it had nothing to do with the code. The issue had to deal with permissions set on the account that the emails were being sent to. My personal email wasn't allow to receive this type of email, the netadmin's email account used as $to and the emails went through just fine.