【发布时间】:2011-08-24 10:04:08
【问题描述】:
所以,我想使用mail() 为我的网站发送注册电子邮件,但是我想让它看起来不错,同时在必要时回退到好的旧明文;混合邮件。
但是我希望它从电子邮件为 johndoe@example.com 的 John Doe 发送到接收者@example.com。
HTML 代码应为<html><head><title>HTML email!</title></head><body><p>This is HTML!</p></body</html>,明文消息应为This is plaintext.
mail() 的参数是什么?我知道其中很多都涉及以某种疯狂的方式更改标题。
非常感谢!
【问题讨论】:
-
将 Content-Type 设置为
multipart/alternative,如 stackoverflow.com/questions/4897215/php-mail-how-to-send-html - 或查看发送 html 邮件的许多 相关 链接,最终建议不要手动执行此操作裸mail()函数。