Send email from xampp localhost
Send email from xampp localhost. Follow the easy steps
Now you can send email from xampp localhost! enjoy :-)
- Goto http://glob.com.au/sendmail/, download latest sendmail package.
- Extract the zip file and copy the files into your \xampp\sendmail folder(Replace every file in the existing folder).
- Update the sendmail.ini file in sendmail folder with the following details, and make sure it is not commented(;).
Here i have added gmail account for sending emails.
smtp_server=smtp.gmail.com
smtp_port=25
error_logfile=error.log
debug_logfile=debug.log
auth_username=yourname@gmail.com
auth_password=gmailpassword
force_sender=yourname@gmail.com - Open xampp\php\php.ini file find sendmail_path and update its value to
"\"C:\xampp\sendmail\sendmail.exe\" -t"
. Now it will look like below
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
Make sure it's not commented(;) - Restart your apache server.
Now you can send email from xampp localhost! enjoy :-)
Nice post! now i can able to send email from localhost. It ll help me to check email notifications to users after registration. Thank you karthik
ReplyDeleteThanks for your comment sam:)
ReplyDeletegreat post it solved my problem that arises during my project work
ReplyDeleteplz send ur full code sir.bcoz myself not working....
DeleteHi thanks for the PHP mail post its so clearly explaianed in,
ReplyDeleteI am having issues receiving the mails sent from localhost, on my localhost the mailform.php is executed successfully without any error messages but unfortunately I am not receiving the same. Plz do the needful
Hello Karthik,
ReplyDeleteI had done all the settings which were mentioned above but while sending the email, it shows that the mail have been sent but sent email address does't recieve any email from the sent mail....
Can you explain why it had dappened...?
Hi sunil, please check your debug.log and error.log file in sendmail folder to fine the error.
ReplyDeleteHi Raj, please make sure that you have entered correct email and password, check your log files in sendmail folder to find what would be the problem
ReplyDeleteI've tried all your steps. I've checked "error.log" and "debug.log" and its blank. No error found.
ReplyDeleteThis is my php code:
---------------------------------------------------------------
$from = FROM_EMAIL;
$to = TO_EMAIL;
$subject = FHD_TITLE . ' New Registration';
// message
$message = '
New Registration
New User Registration
Name: ' . $name . '
Login: ' . $login . '
Email: ' . $email . '
';
$headers = "From:" . $from . "\r\n";
$headers .="Reply-To: " . $from . "\r\n";
$headers .="MIME-Version: 1.0" . "\r\n";
$headers .="Content-type: text/html; charset=iso-8859-1" . "\r\n";
if (mail($to, $subject, $message, $headers))
{
echo "Message Sent";
}
else
{
echo "Message Sending Failed";
}
Message appear on the page is "Message Sent". But no incoming email received.
Can you help me with this?
Hi Can someone help me, I followed all the steps, But it's not working for me, Here's the content on my debug and error file:
ReplyDeleteError: 13/04/27 08:53:06 : Connect timed out.
Debug:
13/04/27 08:52:56 ** --- MESSAGE BEGIN ---
13/04/27 08:52:56 ** To: bbmanalaysay@gmail.com
13/04/27 08:52:56 ** Subject: This is subject
13/04/27 08:52:56 ** From:abc@somedomain.com
13/04/27 08:52:56 **
13/04/27 08:52:56 ** This is simple text message.
13/04/27 08:52:56 ** --- MESSAGE END ---
13/04/27 08:52:56 ** Connecting to smtp.gmail.com:25
13/04/27 08:53:06 ** Disconnected.
13/04/27 08:53:06 ** Disconnected.
13/04/27 08:53:06 ** Disconnected.
13/04/27 08:53:06 ** Disconnected.
13/04/27 08:53:06 ** Connect timed out.
I think you could try changing the smtp_port:25 in senmail.ini file to smtp_port:587
ReplyDeleteThanks man, i am a newbie to php and the code helps me a lot to test mail function locally...
ReplyDeletehey ...i am not able to send mail...
ReplyDeleteHi Sharmishtha Rathod,
ReplyDeleteCould you please elaborate your problem? so that we can help you, thanks! :)
It is Working but "From:" address is changing
ReplyDeleteFrom address is showing as we have give in the sendmail.ini can any one Help Me
is it not working in windows 8?
ReplyDeletedidn't have a chance to check it in windows 8 friend. I will try this and let you know :)
ReplyDeleteOK, because I alreadry tried it and it didn't work :)
ReplyDeleteoh ok.. anyway i will try from my side!!
ReplyDeleteoh ok, just let me know if you're done with it :)
ReplyDeleteHi & thank you very much!
ReplyDeleteI have tried many others instructions around the web and after a fat hour of trying nothing work for me!
I think the key for me was outdated sendmail.exe (year 2009). So update instruction must be crucial.
How to simply test outside of wordpress?
1. Create PHP file with code:
2. Execute
Greetings, Jurij
plz send me the details of sendmail in xammp using php in windows 7-sumitk223@gmail.com.@karthik
ReplyDeleteThanks for your post. I tried same but nothing happened.
ReplyDeleteHow can I solve it? How to check debug.log and error.log file. I do not see such file in sendmail folder.
Thanks for your time.
Thanks working perfect
ReplyDeleteNot Working For Me Man
ReplyDeleteThe Script Is Running Without error but i am not getting mail in myinbox
That did really solve my problem .. lolthank you very much Nathaniel
ReplyDeletethis is the perfect answer. but it is not possible to send message from xampp. it means i think you also can purchase the domain for do it.
ReplyDeletefrom the reply of the all internet users all says not work.. not work.. not work....
And it is a very critical problem for every web developer.
Hi Siraj,
ReplyDeleteThanks for your feedback. I was used this steps in Win XP localserver. It was worked on that time. I agree that currently this solution is not working for me also(Currently using Win 8). Soon i will update this post with right solution. Thanks!
I have completed every necessary steps and the message is also showing that the mail is sent but i am not receiving any mail at all, if there is any solution please inform me the same
ReplyDelete[…] In my case, I did everything like in this tutorial:http://www.websnippetz.com/php/send-email-from-xampp-localhost/ […]
ReplyDeleteWorking perfect bro ...
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIt's not working for me on windows 7 .. Not error occur but my email id inbox have not accept any email from localhost.
Deleteits not working i am using window 8.1.. I follow all the steps that are mentioned but still not able to send mail from localhost plz help me....
ReplyDeleteits not working ..in error log .. connection time out why ?
ReplyDeletei am unable to send mail :(
ReplyDeletehelp me guyz i am behind the router and my email.php script says email sent but m not getting any email
ReplyDeleteWhen send mail then show message sent but didn't received any mail and debug.log give these message
ReplyDelete15/12/17 00:56:14 ** --- MESSAGE BEGIN ---
15/12/17 00:56:14 ** To: msrasel2014@gmail.com
15/12/17 00:56:14 ** Subject: Test mail
15/12/17 00:56:14 **
15/12/17 00:56:14 ** This is a test mail
15/12/17 00:56:14 ** --- MESSAGE END ---
15/12/17 00:56:14 ** Connecting to smtp.gmail.com:587
15/12/17 00:56:15 ** Connected.
15/12/17 00:56:15 << 220 smtp.gmail.com ESMTP r193sm6404693pfr.65 - gsmtp
15/12/17 00:56:15 >> EHLO DATA-SERVER
15/12/17 00:56:15 << 250-smtp.gmail.com at your service, [103.26.113.218]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
15/12/17 00:56:15 ** Authenticating as m.bashir07@gmail.com
15/12/17 00:56:15 >> STARTTLS
15/12/17 00:56:16 << 220 2.0.0 Ready to start TLS
15/12/17 00:56:16 >> EHLO DATA-SERVER
15/12/17 00:56:16 << 250-smtp.gmail.com at your service, [103.26.113.218]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
15/12/17 00:56:16 >> AUTH LOGIN
15/12/17 00:56:16 << 334 VXNlcm5hbWU6
15/12/17 00:56:16 >> bS5iYXNoaXIwN0BnbWFpbC5jb20=
15/12/17 00:56:17 << 334 UGFzc3dvcmQ6
15/12/17 00:56:17 >> MzIxKmJhc2hpcg==
15/12/17 00:56:17 << 534-5.7.14 534-5.7.14 vfZPrTMhB77ph5J959E06h0qAycU3BMz5nmUl0yPlVKigeDpPeTjw9P4Lwu-fmEOiEXCxR534-5.7.14 RNWokOSDINJzOehfEjXTt6OGI15QS_56nCdEeQ_jLVL0HMkm1kRUR7LQNi4WLCdIjG8WVK534-5.7.14 j_CKlZGiG6SRq5gL26WXWseFHHgVyqbbeM2u_wiY6QLOiTj7K_JnfRMCjbKyNFsEnRSZDZ534-5.7.14 zvOLNgzE4pO-PSo8vm_FPJzo7ZJk> Please log in via your web browser and534-5.7.14 then try again.534-5.7.14 Learn more at534 5.7.14 https://support.google.com/mail/answer/78754 r193sm6404693pfr.65 - gsmtp
15/12/17 00:56:17 ** Disconnecting from smtp.gmail.com:587
15/12/17 00:56:17 ** Disconnected.
15/12/17 00:56:17 ** Disconnected.
15/12/17 00:56:17 ** vfZPrTMhB77ph5J959E06h0qAycU3BMz5nmUl0yPlVKigeDpPeTjw9P4Lwu-fmEOiEXCxRRNWokOSDINJzOehfEjXTt6OGI15QS_56nCdEeQ_jLVL0HMkm1kRUR7LQNi4WLCdIjG8WVKj_CKlZGiG6SRq5gL26WXWseFHHgVyqbbeM2u_wiY6QLOiTj7K_JnfRMCjbKyNFsEnRSZDZzvOLNgzE4pO-PSo8vm_FPJzo7ZJk> Please log in via your web browser andthen try again. Learn more at https://support.google.com/mail/answer/78754 r193sm6404693pfr.65 - gsmtp
it fails for me .... but thanks for sharing
ReplyDeletei followed your tutorials links but unable to receive the email and not getting mails from local xampp server .so could tell me that how to send a mail from local server ......thanks
ReplyDelete