doulu8341 2013-07-31 15:57
浏览 356
已采纳

尝试使用在Microsoft的SMTP服务器(@ live.com,@ outlook.com等)上配置的电子邮件地址通过PHP发送电子邮件

I'm trying to send email via a PHP script. Here's the line of code that is supposed to send the email:

mail($owner_email, $subject, $messageBody, $headers)

Here are what my variables are set to:

$owner_email = mike@mikemarks.net

$subject = "Blah"

$messageBody = "Blah"

The email address, mike@mikemarks.net, is configured on Microsoft's email servers. I have email sending and receiving from their servers - smtp.live.com (for outgoing). For some reason, the above line of code isn't sending an email to mike@mikemarks.net.

QUESTIONS:

  1. Are there certain email services that won't work with PHP's email functionality, such as Microsoft's?
  2. I understand I can't set SMTP settings in PHP - does this mean that PHP uses its own SMTP server?
  • 写回答

2条回答 默认 最新

  • dongshungou7699 2013-07-31 16:03
    关注

    PHP uses the SMTP server specified in the php.ini. Most often, it's localhost, which uses the hosting server's own SMTP server. Check the response of the mail function (true/false) to make sure that the email is going through, and check the mail log of the server to see if there's an error there. You can see http://www.phpclasses.org/blog/package/9/post/1-Sending-email-using-SMTP-servers-of-Gmail-Hotmail-or-Yahoo-with-PHP.html for information how to use Hotmail as the SMTP server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?