PHP邮件功能,无效地址

编程入门 行业动态 更新时间:2024-10-25 23:32:57
本文介绍了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", $subject, $message, ''From: SomeName <someotherEmail@address>'' )

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

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>") message, ''From: SomeName <someotherEmail@address>'' )

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

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邮件功能,无效地址

本文发布于:2023-08-07 10:25:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318610.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮件   地址   功能   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!