PHP mail()无法发送到内部地址 [英] PHP mail() failing to send to internal addresses

查看:73
本文介绍了PHP mail()无法发送到内部地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户忘记密码登录到正在创建的系统时,我试图发送密码重置链接。问题是,在我的系统托管的服务器上未配置smtp服务器。因此,每当我尝试使用php mail()函数将电子邮件发送到内部电子邮件地址时,电子邮件都将无法发送,但是在外部电子邮件地址(使用gmail帐户进行了测试)下,电子邮件将通过。我相信这是因为我的服务器是直接发送到Internet,而不是通过内部的smtp服务器来解析应将域电子邮件发送到哪里。我想知道是否有人知道如何在Xserve上配置它,或者他们是否知道如何特别告诉php mail()函数最初在哪里发送电子邮件。任何帮助或指向正确的方向将非常有帮助。

I am trying to send out password reset links for when users forget their password to login to a system I am creating. The problem is, the smtp server is supposedly not configured on the server my system is hosted on. So whenever I try to use the php mail() function to send an email to an internal email address, the emails fail to send, but outside email address (tested with a gmail account), the emails go through. I believe this is because my server is sending directly out to the internet instead of passing through an internal smtp server to resolve where our domain emails should be sent. I was wondering if anyone knew how to configure this on an Xserve or if they knew how to specifically tell the php mail() function where to initially send the email. Any help or pointing in the right direction would be extremely helpful.

谢谢!

推荐答案

mail()不发送邮件,它只是将内容移交给本地SMTP服务器。它不会联系收件人的服务器来传递邮件。用现实的术语来说,mail()会把您的信带到大街上,然后将其放入附近的邮箱。之后,它与邮件传递完全无关。

mail() doesn't send mail, it just hands things over to the local SMTP server. It does NOT reach out to the recipient's server to deliver the mail. In real world terms, mail() walks your letter down the street and drops it into the neighborhood mailbox. After that, it has absolutely nothing more to do with mail delivery.

检查本地SMTP服务器的日志,以了解为什么不传递本地邮件。应该有一两行说明为什么要注册。也许本地MTA(邮件传输代理,又称为本地邮件人)配置不正确。

Check your local SMTP server's logs to see why the local mails aren't being delivered. There should be a line or two saying why it's registered. Perhaps the local MTA (mail-transfer agent, aka the local "mail man") isn't configured properly.

这篇关于PHP mail()无法发送到内部地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆