开发者

PHP mail not showing up on email

I have created a small script that sends a multipart email via php the mail() (that has been a challenge in itself!).

When I test the s开发者_C百科cript and send and email it all works fine, but when I try another address (one which has the same domain as the server) the email appears blank. All the content is there when you look at the raw code, but nothing displays.


I solved the problem by removing the doctype tag from the code and left everything bare coded.

I also noticed the php variable

$body=' (html code here) '

The whitespace after ' was causing the email to show up empty sometime... I'm not exactly sure why!


I have encountered a similar issue and it was because I had a website www.example.com sending an email to me@example.com but the web server and email servers were on different machines. I had to ask the host to sort it so that the website wouldn't try to route emails within the server itself.


I managed to sort this by changing my own code to instead using something a little more supported - phpMailer.

I found this very easy to use and install into my own code. Also giving me as much flexibility as I had with my original code.

I guess though this isn't sorting the original problem, but it did seem to sort on my code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜