我已经使用 PHP 代码使用 SMTP HOST 进行邮件发送,如下所示:
        ini_set('SMTP','myserver');
ini_set('smtp_port',25);
$to = $email;
$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers  .= "From: NO-REPLY<no-reply@mydomain.com>" . "\r\n";
$subject = "Confirmation For Request";
$message = '<html>
                <body>
                    <p>Hi '.$firstname.' '.$lastname.'</p>
                    <p>
                        We recieved below details from you. Please use given Request/Ticket ID for future follow up:
                    </p>
                    <p>
                        Your Request/Ticket ID: <b>'.$ticketID.'</b>
                    </p>
                    <p>
                    Thanks,<br>
                    '.$team.' Team.
                    </p>
                </body>
            </html>';
mail( $to, $subject, $message, $headers ); 
现在,当我在 Windows 本地主机中执行代码时。我成功地收到了邮件,而如果我在我的 Linux 设置上使用相同的代码,我不会收到任何邮件,尽管 mail() 函数在 linux 机器中也返回 true。 ...
在查看 Windows localhost 和 Linux 服务器的 phpinfo 时,对于邮件参数,我发现了一个区别,
在 Windows 中,我发现 sendmail_path == “No Value”,而在 linux 服务器上,它显示“usr/sbin/sendmail -t -i”
有人可以帮我解决这个问题吗?
注意:在 Windows 中,它是 WAMP 设置,而 Linux 是专用服务器...