CodeIgniter Forums
Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - 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: Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) (/showthread.php?tid=56824)



Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]Unknown[/eluser]
Hi All,

I have tried few times but not been able to send mail using codeigniter.

Can somebody please help me with Teamviewer ( I have already wasted half of my day on old thread which are no more relevant)

Here is the error which i get



Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Wed, 23 Jan 2013 11:52:49 +0000
From: "Steven"
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_50ffcf11a2031"


=?utf-8?Q?Confirm_your_account?=
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_50ffcf11a2031
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Thank you for Signup Click here to confirm your account.


--B_ALT_50ffcf11a2031
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p> Thank you for Signup<p><p> <a > Click here </a> to c=
onfirm your account.<p>

--B_ALT_50ffcf11a2031--

Failed


Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]Otemu[/eluser]
This will provide the solution to your problem
http://arunss.wordpress.com/2009/12/09/sending-email-from-localhost-using-php/
and check this out
http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html



Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]Unknown[/eluser]
Thanks for your time Otemu, as i am newbee can you please help in seeting up the files as well.. like

Where do I put this email.php file?


Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]Otemu[/eluser]
Hi,

No need to put the email file anywhere its already included with codeigniter, infact ignore them fiels you downloaded probably not the best example :red:

In fact just do this in one of your controllers:

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

$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');

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

To configure your localhost
1) Open the “php.ini“. You should know where it is located because it depends upon the particular server you’re running.

2) Search for the attribute called “SMTP” in the php.ini file.Generally you can find the line “SMTP=localhost“. change the localhost to the smtp server name of your ISP. And, there is another attribute called “smtp_port” which should be set to 25.I’ve set the following values in my php.ini file.

SMTP = smtp.wlink.com.np
smtp_port = 25

3) Restart the apache server so that PHP modules and attributes will be reloaded.

4) Now try to send the mail using codeigniter


Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]Otemu[/eluser]
Here is a more detailed example using XAMPP

http://expertester.wordpress.com/2010/07/07/how-to-send-email-from-xampp-php/


Unable to send email using PHP mail(), sending Email from wamp with codeigniter (local) - El Forum - 01-23-2013

[eluser]xerobytez[/eluser]
I like to use the phpmailer library in my applications, makes things very flexible as it supports multiple emailing methods. It's also pretty straight forward and easy to use. Take a look at https://code.google.com/a/apache-extras.org/p/phpmailer/ for more info.