开发者

Mail not delivered to gmail or hotmail address

开发者 https://www.devze.com 2023-01-15 06:16 出处:网络
I have setup a mail sender with the Codeigniter email library. Everything works fine until a user specifies a gmail or hotmail address as their address.

I have setup a mail sender with the Codeigniter email library.

Everything works fine until a user specifies a gmail or hotmail address as their address.

eg

$email = $this->input->post('something@gmail.com');

This is just a return address for me to reply to. The email itself is sent from a Godaddy email account.

Im wondering if anyone has had similar开发者_C百科 issues with codeigniter email library or Godaddy hosting where simply specifying a email return address causes messages to not be delivered.

The debugger shows no errors when the form is submitted. If I change the value of the users email address just before sending the email eg. string replace gmail to xgmail the mail is sent flawlessly.

Here is my config array

'protocol' => 'sendmail',
'smtp_host' => 'smtpout.secureserver.net',
'smtp_port' => 25,
'smtp_user' => 'info@website.com',
'smtp_pass' => 'password',
'mailtype' => 'text');

I've tried a gmail and godaddy as smtp_hosts. Both times when

$email = $this->input->post('email');

is a gmail or hotmail address the mail never gets delivered.

Ive combed the net for answers but cant seem to find any similar problems.

EDIT:tried to make clearer.


It doesn't get sent Or doesn't get delivered ? Two different things.

If it doesn't get delivered, gmail / hotmail spam filters might be filtering out your email. Did you check your SPAM Inbox ?

If it doesn't get sent, the email might not be correct ? What is the return SMTP reply code ? is it 5xx ?

I wanted to comment, instead of "Answer" but apparently I can't yet. (sorry)


OK, you try to send emails via the Gmail SMTP server, but you have set the protocol wrong. Set the protocol to smtp, and set the hostname and port accordingly.


I had the same problem and after a lot of searching I finally found the solution. These configuration settings work for me:

$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'relay-hosting.secureserver.net';
$config['smtp_port'] = '25';
$config['mailtype'] = 'html';

Note: it is not necessary to provide username and password. Make sure the email you are sending does not contain too many links. It will be marked as spam by GoDaddy's mailserver.

If it still doesn't work with these settings, use the print_debugger to see the exact response from the mail server:

$this->email->send();
echo $this->email->print_debugger();
exit;
0

精彩评论

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