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

尝试使用在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条)

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站