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条)

报告相同问题?

悬赏问题

  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。