发件人地址不适用于 PHP 邮件标头 [英] From address is not working for PHP mail headers

查看:29
本文介绍了发件人地址不适用于 PHP 邮件标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 PHP 发送无回复"邮件邮件 功能.问题是当我使用以下发件人"标题时,邮件已发送,但收件箱中未收到:

I'm sending "no-reply" mails using PHP mail function. The problem is that mails were sent, but not receiving in my inbox when I use the following "From" headers:

  1. 发件人:发件人姓名
  2. 来自:noreply@localhost.com
  3. 发件人:发件人姓名

我没有实际的邮件地址 noreply@localhost.com,但我有 test@localhost.com.
我认为根据 PHP 文档,所有这些都是正确的格式.

I have no actual mail address noreply@localhost.com, but I have test@localhost.com.
I think all of them are the correct formats according to the PHP documentation.

当我尝试 From: test@localhost.com 时,它确实有效并且我收到了邮件.
我真的很想使用 1 号格式 Form: My Site Name .它应该工作.有什么想法吗?

When I tried From: test@localhost.com, it did work and I received the mail.
I really want to use the No. 1 format Form: My Site Name <noreply@localhost.com>. It should work. Any idea?

我使用 XAMPP 1.6.7 和 PHP 5.2.6 和 MercuryMail.>

I'm using XAMPP 1.6.7 with PHP 5.2.6 and MercuryMail.

推荐答案

由私人邮件服务器和动态 ip 发送的电子邮件被大多数电子邮件提供商拒绝以防止垃圾邮件.您的提供商似乎就是其中之一.

您可以寻找提供 smtp 中继服务器的提供商,但也许那时无法更改发件人"地址.这取决于提供商.

You can take a look for a provider which gives you a smtp-relay server, but maybe it's not possible to change the "From"-adress then. That depends on the provider.

另一种可能性是由电子邮件提供商(例如 gmail)创建一个帐户并使用电子邮件提供商提供的 SMTP 服务器.但是,您也无法更改发件人"地址.

The other possibility is to create an account by an email provider (for example gmail) and use the SMTP server given by the email provider. But then you can't change the "From" address, too.

这篇关于发件人地址不适用于 PHP 邮件标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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