CodeIgniter Forums
email class help with googleapp email service - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: email class help with googleapp email service (/thread-23208.html)



email class help with googleapp email service - El Forum - 10-03-2009

[eluser]joeizang[/eluser]
hi y'all,

I just have this as a question, does googleapps email provide an smtp server with settings that can be used with the email class. I tried what I could but nothing seems to work. I don't really have any code to paste but anyone ever tried using this service? how do I get it to work. My intention is that from a clients site suggestions can be sent to me from their website so I can keep track of any difficulties they have. Someone before me setup their email to work with googleapps so I am trying to make this work.

God bless


email class help with googleapp email service - El Forum - 10-04-2009

[eluser]eoinmcg[/eluser]
Have a look at this:
http://ellislab.com/forums/viewthread/84689/


email class help with googleapp email service - El Forum - 10-04-2009

[eluser]joeizang[/eluser]
hey eoinmcg,

I just want to say thanks your link proved vital and important.

Many thanks and Long live the CodeIgniter Community and Forums.

God Bless


email class help with googleapp email service - El Forum - 10-04-2009

[eluser]joeizang[/eluser]
<?php
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 587,
'smtp_user' => '[email protected]',
'smtp_password' => 'emailadmin'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
//send emails
$this->email->from($this->input->post('emailaddress'),$this->input->post('name')); $this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->subject('Suggestions');
$this->email->message($this->input->post('emailbody'));
if($this->email->send()){ echo "Your Message was sent and noted...";}
?>

This is my email code snippet. When I send I get the following error which is funny:
<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol</p>
<p>Filename: libraries/Email.php</p>
<p>Line Number: 1652</p>

This is on a development server using XAMPP with php_openssl.dll enabled in the ini file.
any clues?


email class help with googleapp email service - El Forum - 10-04-2009

[eluser]eoinmcg[/eluser]
Hmmm... been along time since I developed on Windows so not too sure.

Take a look at this:
http://forums.devnetwork.net/viewtopic.php?f=52&t=96525

There's a couple of ideas there that might help.

Good luck!


email class help with googleapp email service - El Forum - 10-04-2009

[eluser]joeizang[/eluser]
Hey thanks for the replies,

So far I can connect to gmail. 587 for smtp ssl was not working so i have gone with 465 is fine. but I keep getting errors like this below:

220 mx.google.com ESMTP d4sm5683430fga.7
<br /><pre>hello: 250-mx.google.com at your service, [82.128.53.80]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250 PIPELINING
</pre>Failed to authenticate password. Error: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. d4sm5683430fga.7
<br /><pre>from: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 d4sm5683430fga.7
</pre>The following SMTP error was encountered: 530-5.5.1 Authentication Required.

I should say that I know my password and account name are correct so is there something I should be seeing?

Thanks for the help


email class help with googleapp email service - El Forum - 10-05-2009

[eluser]eoinmcg[/eluser]
Quote:Failed to authenticate password. Error: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. d4sm5683430fga.7

Could it just be temporary system problem?

An other possibility is that your account has been suspended. Try logging in via your browser and, if suspended, will prompt you to enter a captcha.


email class help with googleapp email service - El Forum - 10-05-2009

[eluser]joeizang[/eluser]
Hi again,

I am sorry I keep coming back with this issue. I checked my account and it's fine( signed on no captcha) and still nothing. It still returns this to me:

220 mx.google.com ESMTP d13sm702743fka.52
<br /><pre>hello: 250-mx.google.com at your service, [82.128.53.160]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250 PIPELINING
</pre>Failed to authenticate password. Error: 454 4.7.0 Cannot authenticate due to temporary system problem. Try again later. d13sm702743fka.52
<br /><pre>from: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 d13sm702743fka.52
</pre>The following SMTP error was encountered: 530-5.5.1 Authentication Required.

i saw a post somewhere in my googling that php mail() does not do smtp with google mail well, is that true? if so I looked at the wiki on phpmailer and swiftmailer and the writeup is scanty, so any ideas on what to do? possibly with links or tips.... ANYTHING PLEASE!!!!

God bless


email class help with googleapp email service - El Forum - 10-05-2009

[eluser]joeizang[/eluser]
hey all,

I just thought I should make it known that I unfortunately found something about CI that did not tickle my fancy: Email Library. All the errors above is the result of my attempting to get it to work. So I decided to use phpmailer as a plugin and one time it worked like a charm. I guess I have found that CI can work flexibly with other classes well.
This might just be me so won't discourage anyone to use the email library.