Get cool snippets on php, css, jQuery, Magento and wordpress

Send email from xampp localhost

Send email from xampp localhost. Follow the easy steps

  1. Goto http://glob.com.au/sendmail/, download latest sendmail package.
  2. Extract the zip file and copy the files into your xamppsendmail folder(Replace every file in the existing folder).
  3. Update the sendmail.ini file in sendmail folder with the following details, and make sure it is not commented(;).

    [email protected]
    [email protected]

    Here i have added gmail account for sending emails.

  4. Open xamppphpphp.ini file find sendmail_path and update its value to ""C:xamppsendmailsendmail.exe" -t". Now it will look like below

    sendmail_path = ""C:xamppsendmailsendmail.exe" -t"

    Make sure it’s not commented(;)

  5. Restart your apache server.

Now you can send email from xampp localhost! enjoy πŸ™‚

karthi s

40 thoughts on “Send email from xampp localhost

  1. 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

  2. Hi Siraj,
    Thanks 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!

  3. this 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.
    from 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.

  4. Thanks for your post. I tried same but nothing happened.

    How 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.

  5. Hi & thank you very much!
    I 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

  6. It is Working but "From:" address is changing
    From address is showing as we have give in the sendmail.ini can any one Help Me

  7. 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:

    Error: 13/04/27 08:53:06 : Connect timed out.

    13/04/27 08:52:56 ** — MESSAGE BEGIN —
    13/04/27 08:52:56 ** To: [email protected]
    13/04/27 08:52:56 ** Subject: This is subject
    13/04/27 08:52:56 ** From:[email protected]
    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.

  8. I've tried all your steps. I've checked "error.log" and "debug.log" and its blank. No error found.

    This 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 . "rn";
    $headers .="Reply-To: " . $from . "rn";
    $headers .="MIME-Version: 1.0" . "rn";
    $headers .="Content-type: text/html; charset=iso-8859-1" . "rn";
    if (mail($to, $subject, $message, $headers))
    echo "Message Sent";
    echo "Message Sending Failed";

    Message appear on the page is "Message Sent". But no incoming email received.
    Can you help me with this?

  9. Hi 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

  10. Hello Karthik,

    I 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…?

  11. Hi thanks for the PHP mail post its so clearly explaianed in,

    I 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

  12. 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

  13. When send mail then show message sent but didn't received any mail and debug.log give these message

    15/12/17 00:56:14 ** — MESSAGE BEGIN —
    15/12/17 00:56:14 ** To: [email protected]
    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, []250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
    15/12/17 00:56:15 ** Authenticating as [email protected]
    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, []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

  14. i 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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: