• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$this->email->send() returns nothing

#1
[eluser]redcloud80[/eluser]
Why $this->email->send() returns nothing (blank html)?

Code:
public function __construct()
{
  parent::__construct();
  $this->load->library('email');
}

public function send_confirmation_email()
{
  $user_email =  '[email protected]';
  
  $this->email->from('[email protected]', 'ttt');
  $this->email->to($user_email);
  $this->email->subject('Registration confirmation');
  $this->email->message('Please click this link to confirm your registration ');
  
  die($this->email->send());
}

This is my email.php config file

Code:
$config['protocol'] = 'smtp';
$config['charset'] = 'iso-8859-1';//'utf-8';
$config['mailtype'] = 'text';

$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'mypass';
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 5;

Any idea?

#2
[eluser]TWP Marketing[/eluser]
die() stops execution of the script.
It can't return anything.

#3
[eluser]redcloud80[/eluser]
Sure, but it should print at least TRUE or FALSE, according send() documentation.

#4
[eluser]TWP Marketing[/eluser]
Try this:
$result = $this->email->send();
die('The result is: '.$result);

#5
[eluser]redcloud80[/eluser]
The output: "The result is: "

#6
[eluser]CroNiX[/eluser]
Code:
die($this->email->print_debugger());

#7
[eluser]redcloud80[/eluser]
An empty pre...

Code:
<pre>

</pre>

#8
[eluser]CroNiX[/eluser]
[quote author="redcloud80" date="1347306335"]Sure, but it should print at least TRUE or FALSE, according send() documentation.[/quote]
it does if you use var_dump($var), since it's a boolean and not a string it won't print "true/false" to the screen...

#9
[eluser]redcloud80[/eluser]
[quote author="CroNiX" date="1347312562"][quote author="redcloud80" date="1347306335"]Sure, but it should print at least TRUE or FALSE, according send() documentation.[/quote]
it does if you use var_dump($var), since it's a boolean and not a string it won't print "true/false" to the screen...[/quote]
Correct. It returns boolean FALSE. Where I can find some log files about this?

#10
[eluser]CroNiX[/eluser]
I don't see where you initialize your email with the $config. You only define the $config.
Code:
$this->email->initialize($config);
Sounds like you need to check your mail server error logs...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.