zizther
zizther

Reputation: 854

Issues with Google SMTP and CodeIgniter

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.

Upvotes: 0

Views: 7327

Answers (3)

Sigismund
Sigismund

Reputation: 1082

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.

Upvotes: 1

WebNovice
WebNovice

Reputation: 2220

Add the following line to your email config:

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

Upvotes: 3

ow3n
ow3n

Reputation: 6587

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

Upvotes: 0

Related Questions