开发者

PHP send MIME emails...doesn't work anymore

开发者 https://www.devze.com 2022-12-17 00:17 出处:网络
I just switched from a shared server to a virtual dedicated. The whole site works, but my mail forms have quit sending MIME emails the way they used to.

I just switched from a shared server to a virtual dedicated. The whole site works, but my mail forms have quit sending MIME emails the way they used to.

What used to appear before the server switch:

hallo fwend

What appears now in the emails (appears as though my client doesn't support MIME):

Content-Type: multipart/alternative; boundary="==DL- bound_b08bcfabdc459ae7e87e493a984115b3"

This is a multipart MIME message from your friends at Example.com. If you are reading this, it seems we h开发者_如何学编程ave a message to deliver, but your mail client is not set to receive these types of messages. We are sorry for the inconvenience :(

--==DL-bound_b08bcfabdc459ae7e87e493a984115b3

Content-Type: text/plain; charset=iso-8859-1

Content-Transfer-Encoding: 7bit

hallo fwend

Is there some switch in PHP or something that I need turned on to send MIME?


It look like the headers are send in the body part of the message. I had this problem a while back.

Possible causes are:

1. EOL
I used "\r\n" as eol for the MIME headers (following the spec) , but the (shared)server wanted an "\n"

2. Last header
Some mail server add some headers of their own. If the last header end with "\n" and the mail server could also mess thing up.

3. Empty header
An empty header which causes a "\n\n" in the $headers will corrupt the headers. The "\n\n" aka "empty line" marks the end of the headers part of a email (or the start of the body)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号