$this->email->send() returns nothing - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: $this->email->send() returns nothing (/showthread.php?tid=54472) Pages:
1
2
|
$this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]redcloud80[/eluser] Here I can read that there's no need to initialize something http://ellislab.com/codeigniter/user-guide/libraries/email.html Setting Email Preferences in a Config File If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() function if you save your preferences in a config file. $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]TWP Marketing[/eluser] Looking at the email library function send(), I agree it should return only true or false. I wonder if your server or php version is not converting that to numeric 1/0 or text '1'/'0'. Conditional, check for exact boolean, numeric or text output types Code: if( $this->email->send() === null ) $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]CroNiX[/eluser] Also, search the forum for sending email through gmail. I think you need to use SSL, like: Code: $config['smtp_host'] = 'ssl://smtp.googlemail.com'; $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]CroNiX[/eluser] [quote author="redcloud80" date="1347312980"]Here I can read that there's no need to initialize something http://ellislab.com/codeigniter/user-guide/libraries/email.html Setting Email Preferences in a Config File If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.[/quote] I'm pretty sure there's a bug with that that hasn't been fixed and also with doing $this->load->library('email', $config). Try manually initializing it like I suggested. It definitely wouldn't hurt anything... $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]redcloud80[/eluser] I've added ssl to the smtp_host, $config['smtp_timeout'] = 5 and $this->email->initialize(); before $this->email->send(). The request never ends, it's still loading... I'm sure that the smtp server is perfectly working. $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]redcloud80[/eluser] Finally the "answer": Fatal error: Maximum execution time of 300 seconds exceeded in... Code: 3 0.0437 5008472 call_user_func_array ( ) ..\CodeIgniter.php:359 $this->email->send() returns nothing - El Forum - 09-10-2012 [eluser]redcloud80[/eluser] This is how I solved Code: $config['crlf'] = "\r\n"; :\ |