1
votes

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('[email protected]');

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 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' => '[email protected]',
'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.

3
At what point exactly does sending the email fail (and how do you know)? I know that codeigniter's function for sending mail returns a boolean, is that all you're going off of?Matthew
Theres no notice of failure. Just no email gets delivered when the user specifies a gmail or hotmail address as their reply to addresschris
Have you tried any other email providers, e.g. your private mail server? Do you have access to your smtp server logs that handles the sending (or whatever you use)?Residuum
Ive tried Gmail and the Godaddy email account. Both gave identical results. A email form that works but wont delivery when the return address is gmail or hotmail. Would I be able to get server logs from gmail if I switch it back to gmail configuration?chris
Good luck asking Google for access to their SMTP server logs ;)Residuum

3 Answers

0
votes

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)

0
votes

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.

0
votes

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;