CodeIgniter Forums
Sending Email Not Working - 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: Sending Email Not Working (/showthread.php?tid=17150)

Pages: 1 2


Sending Email Not Working - El Forum - 03-27-2009

[eluser]renga[/eluser]
I used

$this->load->library('email'); in my project . Mails are not working properly ... can anyone suggest what the problem is?


Sending Email Not Working - El Forum - 03-27-2009

[eluser]Clooner[/eluser]
Maybe your code and or your mail settings are the problem Big Grin
[quote author="renga" date="1238152345"]I used $this->load->library('email'); in my project . Mails are not working properly ... can anyone suggest what the problem is?[/quote] What is the error you are getting, what happens, what does not, what are your email settings and what is your code? Sure that your code is more then the
Code:
$this->load->library('email');



Sending Email Not Working - El Forum - 03-27-2009

[eluser]renga[/eluser]
[quote author="clooner" date="1238154279"]Maybe your code and or your mail settings are the problem Big Grin
[quote author="renga" date="1238152345"]I used $this->load->library('email'); in my project . Mails are not working properly ... can anyone suggest what the problem is?[/quote] What is the error you are getting, what happens, what does not, what are your email settings and what is your code? Sure that your code is more then the
Code:
$this->load->library('email');
[/quote]

It shows No Error ....

echo $this->email->print_debugger();


this code shows that mail sent ...... but really mails are not sent


Sending Email Not Working - El Forum - 03-27-2009

[eluser]Clooner[/eluser]
[quote author="renga" date="1238155023"][quote author="clooner" date="1238154279"]Maybe your code and or your mail settings are the problem Big Grin
[quote author="renga" date="1238152345"]I used $this->load->library('email'); in my project . Mails are not working properly ... can anyone suggest what the problem is?[/quote] What is the error you are getting, what happens, what does not, what are your email settings and what is your code? Sure that your code is more then the
Code:
$this->load->library('email');
[/quote]

It shows No Error ....

echo $this->email->print_debugger();


this code shows that mail sent ...... but really mails are not sent[/quote]

Post your settings and your code here. Otherwise I'll stick to that the problem is your settings and or your code Big Grin


Sending Email Not Working - El Forum - 03-27-2009

[eluser]renga[/eluser]
if ($this->form_validation->run() == FALSE) {

$this->load->view('register.tpl', $data);
}
else {
$this->load->model('registration_model');
$chk_register = $this->registration_model->register($_POST);
if($chk_register == true) {

$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);

$this->email->from('[email protected]', 'Enexions');
$this->email->to('E_mail');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
$data['Success'] = "Account Activated Successfully !";
$this->load->view('register.tpl', $data);
}
else {
redirect('/register','refresh');
}
}


Sending Email Not Working - El Forum - 03-27-2009

[eluser]Clooner[/eluser]
Code:
if ( ! $this->email->send())
{
    $errors=$this->email->print_debugger();
   die($errors);
} else
{
   // success here
   die('it worked');
}
. instead of
Code:
$this->email->send();

What happens now? And what happens when you try using a different protocol, does it work then? Is sendmail working correctly?


Sending Email Not Working - El Forum - 03-27-2009

[eluser]renga[/eluser]
It shows that it worked ...... but mails are not sent ...... when i using SMTP same problem arises


Sending Email Not Working - El Forum - 03-27-2009

[eluser]Clooner[/eluser]
[quote author="renga" date="1238160658"]It shows that it worked ...... but mails are not sent ...... when i using SMTP same problem arises[/quote] What do your log files say? sendmail log say? (you might need to enable this first) is sendmail accessed?


Sending Email Not Working - El Forum - 03-27-2009

[eluser]renga[/eluser]
[quote author="clooner" date="1238162829"][quote author="renga" date="1238160658"]It shows that it worked ...... but mails are not sent ...... when i using SMTP same problem arises[/quote] What do your log files say? sendmail log say? (you might need to enable this first) is sendmail accessed?[/quote]

how to view my log files?????????????


Sending Email Not Working - El Forum - 03-27-2009

[eluser]Clooner[/eluser]
First your CI log files which you have to enable in your config file and google about sendmail there are some good pages about that.