PHP邮件功能,无效地址 [英] PHP mail function, Invalid Address

查看:104
本文介绍了PHP邮件功能,无效地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我并没有完全了解此Web开发内容,但是我在组建网站的过程中遇到了一个令人烦恼的问题:

I''m not all up-ons with this web development stuff but I''m part way through putting together a website and have come across an irritating problem:

mail("somebody@someaddress.com", $subject, $message, ''From: SomeName <someotherEmail@address.com>'' )



它抱怨地址无效,我知道这是我必须在标题中设置的发件人"字段.那我想念什么明显的东西呢?如果仅我自己输入电子邮件地址,它就可以工作,但是当我尝试给它添加名称时,它在我的脸上冒了!



It complains about an invalid address, which I know to be the From field I have to set in the header. So what obvious thing am I missing? It works if I just put the email address by itself, but when I try to put a name to it, it blows up in my face!

推荐答案

主题,


消息,来自:SomeName< someotherEmail@address.com>")
message, ''From: SomeName <someotherEmail@address.com>'' )



它抱怨地址无效,我知道这是我必须在标题中设置的发件人"字段.那我想念什么明显的东西呢?如果我仅自己输入电子邮件地址,它就可以工作,但是当我尝试给它添加名称时,它在我的脸上冒了出来!



It complains about an invalid address, which I know to be the From field I have to set in the header. So what obvious thing am I missing? It works if I just put the email address by itself, but when I try to put a name to it, it blows up in my face!


我发现在电子邮件地址周围有一个非常奇怪的工作问题.神秘地调用mail之前调用ini_set("sendmail_from", "");可以使您使用友好名称.太疯狂了.
I found a very strange work around to the problem. Calling ini_set("sendmail_from", ""); just prior to calling mail mysteriously allows you to use the friendly name. It''s madness.


这篇关于PHP邮件功能,无效地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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