0

I have seen a lot of other people had this issue.

I have setup an email form using the Google Mail server to send the email. This worked on my local machine, but once i put it on the server i get this error

The following SMTP error was encountered: 110 Connection timed out
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:

from: 

The following SMTP error was encountered:
Unable to send data: RCPT TO:

to: 

The following SMTP error was encountered:
Unable to send data: DATA

data: 

The following SMTP error was encountered:
Unable to send data: User-Agent: CodeIgniter Date: Thu, 2 Feb 2012 14:24:43 +0000


Here is the setup i have in CI

$config = array (
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_user' => 'emial',
    'smtp_pass' => 'password',
    'smtp_port' => '465',
    'protocol' => 'smtp',
    'charset'  => 'utf-8',
    'mailtype' => 'html',
    'wordwrap' => TRUE
);


I have tried using both port465 and 587, and both ssl://smtp.googlemail.com and tls://smtp.googlemail.com

Any help getting this working would be great.

zizther
  • 814
  • 1
  • 10
  • 26
  • You may want to try the solution [posted here](http://stackoverflow.com/questions/1555145/sending-email-with-gmail-smtp-with-codeigniter-email-library). – Colin Brock Feb 02 '12 at 17:58
  • Thanks, but that is what i have, i don't have an issue with fsockopen issue, it something to do with the port possibly. – zizther Feb 02 '12 at 18:02
  • I'm unsure how much it matters, but I noticed that the `charset` is different. – Colin Brock Feb 02 '12 at 18:35
  • Hi Colin, seems to work if i remove the 'html' it will only send text. Not sure why, but it works... – zizther Feb 03 '12 at 10:41

3 Answers3

3

Add the following line to your email config:

$config['newline'] = "\r\n";
WebNovice
  • 2,230
  • 3
  • 24
  • 40
1

I think it is better if you do not change core files of framework.

In my case

$config['newline'] = "\r\n";

didn't work but adding

$this->email->set_newline("\r\n");

to the method sending an email somehow did the job.

Sigismund
  • 1,053
  • 9
  • 21
0

I was having a similar problem and I was able to send as text by changing $newline in system/libraries/Email.php to \r\n

ow3n
  • 5,974
  • 4
  • 53
  • 51