CodeIgniter Forums
sendmail 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: sendmail email not working (/showthread.php?tid=32888)



sendmail email not working - El Forum - 08-08-2010

[eluser]Zocee[/eluser]
I'm getting problem in sending email. CI script says email sent but i'm not getting email in my inbox as well as spam.

In this server general PHP mail() function is working. I used to use phpmailer class previously but it is also now working good. Now i've shifted to Codeigniter and its not sending email.

I've changed the server to another one but in this new server also same problem. General php mail function and class phpmailer is working but not CI mail.

Please help me.


==================
Controller function is like follows:

function emailchk(){
$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['useragent'] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)";

$this->email->initialize($config);
$this->email->from('[email protected]', 'my friend name');
$this->email->to('[email protected]');
$this->email->subject('Email Test Subject');
$this->email->message('Testing the email body');
$this->email->send();
echo $this->email->print_debugger();
}


==================
Output of debugger is:

Your message has been successfully sent using the following protocol: sendmail

User-Agent: CodeIgniter
Date: Sun, 8 Aug 2010 23:48:03 -0500
From: "friendname"
Return-Path:
To: [email protected]
Subject: =?iso-8859-1?Q?Email_Test_Subject?=
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Testing the email body

==================

Please tell me where i'm wrong. please note: i've changed the email address to unreal emails

Thank you for reading till end.


sendmail email not working - El Forum - 08-08-2010

[eluser]Zocee[/eluser]
I was able to solve the below quoted issue. but still not getting email in my inbox Sad
Quote:Does anybody knows why subject is coming like : =?iso-8859-1?Q?Email_Test_Subject?=



sendmail email not working - El Forum - 08-09-2010

[eluser]Zocee[/eluser]
I'm very much upset no reply yet Sad


sendmail email not working - El Forum - 08-09-2010

[eluser]Genki1[/eluser]
In CI version 1.7.2, the email subject is encoded and the output you are seeing is the result of that encoding.

You can research the details by viewing the system library file “Email.php” and taking a look at the function subject() on Line 347 and the function _prep_q_encoding() on Line 1262.


sendmail email not working - El Forum - 08-09-2010

[eluser]Zocee[/eluser]
Hi Genki1,

The the encoding problem is solved now. but still email is not coming in my inbox.

Thank you.


sendmail email not working - El Forum - 10-06-2010

[eluser]Qasim.B[/eluser]
Hi,
You can use 'mail' as your protocol, this will solve your problem

Code:
$config[‘protocol’] = ‘mail’;

It solved my problem too : :-)


sendmail email not working - El Forum - 10-13-2010

[eluser]Zocee[/eluser]
not working for me Sad(