• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mail not receieved using email library

#1
[eluser]Neha[/eluser]
Hi,

I am trying to send mail using email class library, but I did not get the mail 1 hour is passed.

Here is the code I m using in controller
loading library.........

$this->load->library('email');
Function to send mail

$config['protocol'] = 'sendmail';
$this->email->initialize($config);
$this->email->from('someaddr');
$this->email->to('myaddress');
$this->email->cc('someaddr');

$this->email->subject('subject');
$this->email->message('message');

$this->email->send();

Here is the email.php file in config folder


$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtpye'] = 'html';

Please help me in this issue.

Thanks in advance.

#2
[eluser]Tominator[/eluser]
Hi!

Please use [co.de] tags for your script next time. Back to the problem - I'm using PHPMailer and works great.

Tom.

#3
[eluser]Neha[/eluser]
Hi,
I had tried php mail function but it wasn't working too. I found somewhere that its good to send mail using codeigniter's email library. Please someone help. Is anything wrong in my code as I am not receiving mails.

Thanks
Neha

#4
[eluser]Tominator[/eluser]
Are you sending it from localhost? Because it doesn't work ...

#5
[eluser]Neha[/eluser]
Hi,

No I m not sending it from localhost. Even when I use this
Code:
echo $this->email->print_debugger();
I get the mssg mail succesfully sent, but I did not receieve the mail.

Thanks
Neha

#6
[eluser]Tominator[/eluser]
Hi!

Try PHPMailer, because I have no other solution for you. If it doesn't work, it will be problem of server.

I've attached phpMailer library to this post, copy it to your system/libraries. Example of use:

Code:
$this->load->library('phpmailer');

$this->phpmailer->WordWrap = 50;
$this->phpmailer->IsHTML(true);
$this->phpmailer->Charset = "utf-8";
                
$this->phpmailer->From = 'your_address@something.com';
                
$this->phpmailer->AddAddress('subject_address@something.com');
                
$this->phpmailer->Subject = 'some subject';
$this->phpmailer->Body    = 'some text as body';
$this->phpmailer->AltBody = 'some text for alternative clients';
                
$this->phpmailer->Send();

If you want to do something advanced, take a look into docs:
http://phpmailer.worxware.com/

Tom

#7
[eluser]Neha[/eluser]
Hi,
I am really sorry to bother you, but I m newbie. I got the error could not instantiate mail class this time.

Thanks

#8
[eluser]Zack Kitzmiller[/eluser]
Checkout Postmark, and the Postmark CodeIgniter library. http://www.postmarkapp.com, it should help quite abit, as you won't need to send email from your server anymore.

#9
[eluser]Zocee[/eluser]
I’m having a weird problem here please see the following link:

http://ellislab.com/forums/viewthread/163620/


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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