Problem sending email with Codeigniter - Headers sent in the message body

早过忘川 提交于 2019-12-04 07:03:08

This sounds like it is not a codeigniter problem.

You have tested and shown that the message sends correctly. You have seen that it sends to the other POP3 account. GMail is able to go get the POP3 account data but is garbeling it up.

The next test is to use a client, say, Thunderbird (desktop) or Squirrel Mail (web) and see if the mail is arriving correctly to you from these sources.

The next test (if it is not) is to use an entirely different POP3 account with another provider on another server and see what happens there.

The reason for this is that the fault (as you are seeing it) appears to be happening between deliver on the POP3 and arrival at GMail. What I would want as a fault finder is to establish if this is a badly formed email or (and this would be my guess) if the POP3 server has any unusual configuration that CI is maybe not taking into account.

To save time I would post on the CodeIgniter forums to ask if anyone else has experienced these issues in which case there maybe a known bug or fault or shortcoming of some kind. While waiting for an answer I would be looking at my POP3 server and asking it why it is relaying the messages in a way that I do not like and if this is POP3, the server type or a configuration issue. Most importantly once I know what the problem is how can I change my email sending software (CI) to send emails that do not break in this way?

But first knowing the problem's root cause is needed.

Please use $config['protocol'] = 'sendmail';

Since the mail gets delivered to the address in question (the pop3 account) codeigniter/sendmail/php/dns/smtp and all those involved in the mail delivery has done what was expected of them. In addition you have also proven that Google's Mail Fetcher is configured and can successfully fetch mail from the pop3 server and place it in your inbox, nothing wrong there either.

What you want to know is how to change the way these imported from pop3 messages are displayed in your gmail account inbox, which falls way outside the scope of the audience you are targeting here, if your message is delivered our job is done.

One way to solve the problem perhaps, is to send the mail directly to your gmail account instead. As the primary recipient (send to, you may comma separate multiple accounts) or either one of CC or BCC addresses, which will avoid the need to fetch from POP3. This will then be displayed in your inbox as per any other message sent to you with the headers hidden as per usual.

This works for me.

Let us know how things turn out...

I believe this post can help you: Sending E-mails with CodeIgniter

Cleber.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!