Welcome Guest, Not a member yet? Register   Sign In
$this->email->send() returns nothing
#11

[eluser]redcloud80[/eluser]
Here I can read that there's no need to initialize something

http://ellislab.com/codeigniter/user-gui...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.
#12

[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 )
{
die('send null');
}
if( $this->email->send() === true )
{
die('send true');
}
if( $this->email->send() === false )
{
die('send false');
}
if( $this->email->send() === 1 )
{
die('send one');
}
if( $this->email->send() === 0 )
{
die('send zero');
}
if( $this->email->send() === '1' )
{
die('send string one');
}
if( $this->email->send() === '0' )
{
die('send string zero');
}
#13

[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';
#14

[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-gui...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...
#15

[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.
#16

[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
4 0.0437 5008552 Registration->send_confirmation_email( ) ..\CodeIgniter.php:359
5 0.0444 5009664 CI_Email->send( ) ..\registration.php:74
6 0.0447 5011480 CI_Email->_spool_email( ) ..\Email.php:1383
7 0.0447 5011608 CI_Email->_send_with_smtp( ) ..\Email.php:1514
8 1.5201 5026728 CI_Email->_get_smtp_data( ) ..\Email.php:1657

Variables in local scope (#8)

$data =
string '' (length=0)


$str =
Undefined
#17

[eluser]redcloud80[/eluser]
This is how I solved

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

:\




Theme © iAndrew 2016 - Forum software by © MyBB