Quick way – Configure XAMPP To Send Mail Through Localhost 2019?

configure xampp to send mail through localhost

configure xampp to send mail through localhost

Succeed With CONFIGURE XAMPP TO SEND MAIL THROUGH LOCALHOST 2019 In 5 MINUTES?

As we all know that sending mail in xampp through localhost can be much more painful if we don't know to configure xampp to send mail through localhost.

Then I thought it will be helpful to all if I can provide them with an easy solution. After spending my quality time on research finally, I came up with a solution which I am disclosing here.

Xampp is the local best server for PHP, Perl, and MySQL.XAMPP helps to create and develop your own applications using Web services technologies. Many people know from their own experience that it. Easy to use control panel. Let's come to the point of xampp setup to send mail through localhost.

configure xampp to send mail through localhost

Here are the steps :

Set SMTP host and port in  php.ini.
Set sendmail_path = "{path to xampp}\sendmail\sendmail.exe\" -t" in php.ini
In sendmail.ini under sendmail folder in xampp, set
smtp_server to what you have set in php.ini
smtp_port
smtp_ssl
auth_username
auth_password
force_sender
hostname
Simply call the mail function with all the arguments properly passed

 

Step 1 :

Let's write the PHP code in our editor can be Notepad++, PhpStrom, Sublime Text

The PHP code is shown in below:

How to configure XAMPP to send mail from localhost

Step 2:

we can send mail from localhost with sendmail package, Sendmail package is in build in XAMPP.

So if you are using XAMPP then you can easily send mail from localhost.

for example, you can configure C:\xampp\php\php.ini and c:\xampp\sendmail\sendmail.ini for Gmail to send mail.

In C:\xampp\php\php.ini find extension=php_openssl.dll and remove the semicolon from the beginning of that line to make SSL working for Gmail for localhost.

Step 3:

in php.ini file find [mail function] and change

SMTP= smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Now Open C:\xampp\sendmail\sendmail.ini. Replace all the existing code in sendmail.ini with following code

Step 4:

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=my-gmail-password
[email protected]
Now you have done!! create php file with mail function and send mail from localhost.

Note: don't forget to replace my-Gmail-id and my-Gmail-password in above code.
Also, don't forget to remove duplicate keys if you copied settings from above.
For example comment following line if there is another sendmail_path: sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe" in the php.ini file

Remember not to forget to restart xampp control panel so the changes take effect.

Click below links for the video tutorial :

Mail through localhost php
Mail through local host php 2018--- Updated

 

Follows the second method if the first method does not work for you :

You have to configure SMTP on your server

You can use the googles free SMTP server Pretty easy to set up too.

  1. <?php
  2. $mail = new PHPMailer(true);
  3. //Send mail using gmail
  4. if($send_using_gmail){
  5.  $mail->IsSMTP(); // telling the class to use SMTP
  6.  $mail->SMTPAuth = true; // enable SMTP authentication
  7.  $mail->SMTPSecure = "ssl"; // sets the prefix to the servier
  8.  $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
  9.  $mail->Port = 465; // set the SMTP port for the GMAIL server
  10.  $mail->Username = "[email protected]"; // GMAIL username
  11.  $mail->Password = "your-gmail-password"; // GMAIL password
  12. }
  13.  
  14. //Typical mail data
  15. $mail->AddAddress($email, $name);
  16. $mail->SetFrom($email_from, $name_from);
  17. $mail->Subject = "My Subject";
  18. $mail->Body = "Mail contents";
  19. try{
  20.  $mail->Send();
  21.  echo "Success!";
  22. } catch(Exception $e){
  23.     //Something went bad
  24.  echo "Fail :(";
  25. }
  26.  
  27. ?>

62 thoughts on “Quick way – Configure XAMPP To Send Mail Through Localhost 2019?

  1. you’re in point of fact a just right webmaster. The
    site loading speed is incredible. It kind of feels that you are doing any distinctive
    trick. Furthermore, The contents are masterwork.

    you have done a great task on this matter!

  2. you’re in point of fact a just right webmaster. The
    site loading speed is incredible. It kind of feels that you are doing any distinctive
    trick. Furthermore, The contents are masterwork.

    you have done a great task on this matter!

  3. Wow! Excellent blog post! I adore the method described How to configure xampp to send mail
    through localhost in php 2018?. Many thanks until this
    well-arranged guide with reference to How to configure xampp to
    send mail through localhost in php 2018?! This
    is what I became trying to find.
    You can’t say everyone should certainly generate as effective as the
    article author from the page. A lot of people have difficulties containing freelance writing .

    Thinking of doing this, I’ve couldn’t anticipate
    how to target the hassle without online business Thomas.
    In-depth overviews of the largest around the writing
    service providers can certainly help every last single surfer to decide on the ideal specialist

  4. Wow! Excellent blog post! I adore the method described How to configure xampp to send mail
    through localhost in php 2018?. Many thanks until this
    well-arranged guide with reference to How to configure xampp to
    send mail through localhost in php 2018?! This
    is what I became trying to find.
    You can’t say everyone should certainly generate as effective as the
    article author from the page. A lot of people have difficulties containing freelance writing .

    Thinking of doing this, I’ve couldn’t anticipate
    how to target the hassle without online business Thomas.
    In-depth overviews of the largest around the writing
    service providers can certainly help every last single surfer to decide on the ideal specialist

  5. Обязательно к просмотру! Только работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся несравненно объемнее и много эффектно
    – не должен круг погода тереть глаза при демакияже

    магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в любой момент дозволительно снять – трите глаза и спите лицом в подушку
    – не портят свои ресницы

  6. Обязательно к просмотру! Только работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся несравненно объемнее и много эффектно
    – не должен круг погода тереть глаза при демакияже

    магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в любой момент дозволительно снять – трите глаза и спите лицом в подушку
    – не портят свои ресницы

  7. Обязательно к просмотру! Подобно работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся значительно объемнее и много эффектно
    – не надобно круг погода тереть глаза быть демакияже

    магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в всякий момент дозволено снять – трите глаза и спите лицом в подушку
    – не портят свои ресницы

  8. Обязательно к просмотру! Подобно работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся значительно объемнее и много эффектно
    – не надобно круг погода тереть глаза быть демакияже

    магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в всякий момент дозволено снять – трите глаза и спите лицом в подушку
    – не портят свои ресницы

  9. Обязательно к просмотру! Подобно работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся много объемнее и весьма эффектно
    – не должен круг погода тереть глаза при демакияже

    MAGNET LASHES VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в любой момент можно снять – трите глаза и спите лицом в подушку
    – не портят приманка ресницы

  10. Обязательно к просмотру! Подобно работает Magnet Lashes.
    http://sale2017.magnetlashes.mobi/
    Чем хорош Magnet Lashes?
    MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ

    – без утомительного наклеивания
    – гипоаллергенные
    – без неприятного клея
    – не раздражают глаза

    MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ

    – закрепляются намного быстрее, чем наносится тушь
    – смотрятся много объемнее и весьма эффектно
    – не должен круг погода тереть глаза при демакияже

    MAGNET LASHES VS НАРАЩИВАНИЕ В САЛОНЕ

    – существенно дешевле
    – смотрятся также
    – не облетают и не оставляют некрасивые прогалины
    – в любой момент можно снять – трите глаза и спите лицом в подушку
    – не портят приманка ресницы

  11. Микрозайм на карту украины
    Кредит онлайн на карту от 20 лет
    Моментальный кредит на карту киев
    Восточный экспресс банк микрокредит
    Микрокредиты на карту срочно
    Микрозайм заявка онлайн
    Быстро деньги онлайн заявка

  12. Микрозайм на карту украины
    Кредит онлайн на карту от 20 лет
    Моментальный кредит на карту киев
    Восточный экспресс банк микрокредит
    Микрокредиты на карту срочно
    Микрозайм заявка онлайн
    Быстро деньги онлайн заявка

  13. Good day! Terrific content! I really like which you represented How to configure xampp to send mail
    through localhost in php 2018?. Amazing page and as well as incredible
    articles! No doubt that your particular owner is undoubtedly professional is definitely a
    fabulous knowledge in re-writing.
    I wish My partner and i certain quality writing skills.
    I’m a student but i require to construct many newspapers repeatedly .

    There is certainly best ways to get rid of this matter.
    Ought to you to learn more bit.ly there is also a site
    complete with finely detailed records of internet paper marketing organisations.
    You may choose the brains behind is the best for as well
    as place a good journal you choose

  14. Good day! Terrific content! I really like which you represented How to configure xampp to send mail
    through localhost in php 2018?. Amazing page and as well as incredible
    articles! No doubt that your particular owner is undoubtedly professional is definitely a
    fabulous knowledge in re-writing.
    I wish My partner and i certain quality writing skills.
    I’m a student but i require to construct many newspapers repeatedly .

    There is certainly best ways to get rid of this matter.
    Ought to you to learn more bit.ly there is also a site
    complete with finely detailed records of internet paper marketing organisations.
    You may choose the brains behind is the best for as well
    as place a good journal you choose

  15. Individuals school repeatedly discussion about How to
    configure xampp to send mail through localhost in php 2018?, nonetheless i don’t
    know I just completely figure out it should be. I require a tutor, or just a good idea to believe a real coach that are able to present me personally with a lot more insight.
    Might you?

  16. Individuals school repeatedly discussion about How to
    configure xampp to send mail through localhost in php 2018?, nonetheless i don’t
    know I just completely figure out it should be. I require a tutor, or just a good idea to believe a real coach that are able to present me personally with a lot more insight.
    Might you?

  17. It’s a good mouse, works quite well. I know I bought it coz the dimensions said it was a normal sized mouse but ever since I bought another smaller sized one, I find this one bigger and uncomfortable, so that’s why the 4 stars. However, given the price range and the brand value, I’d say it works just fine. So, go for it!

  18. It’s a good mouse, works quite well. I know I bought it coz the dimensions said it was a normal sized mouse but ever since I bought another smaller sized one, I find this one bigger and uncomfortable, so that’s why the 4 stars. However, given the price range and the brand value, I’d say it works just fine. So, go for it!

  19. I have been surfing online more than three hours today, yet I never found
    any interesting article like yours. It’s pretty worth enough for me.

    In my opinion, if all web owners and bloggers made good
    content as you did, the web will be much more useful than ever before.

  20. I have been surfing online more than three hours today, yet I never found
    any interesting article like yours. It’s pretty worth enough for me.

    In my opinion, if all web owners and bloggers made good
    content as you did, the web will be much more useful than ever before.

  21. Ꮋi therе, I ԁo think your site ϲould bе һaving wweb browser compatibility problеms.
    When І takе a lo᧐k at your site in Safari, it looks fine howeνer whsn opening in Internet Explorer, it’sgot ѕome overlapping issues.

    I jᥙst wanted to provide yοu with a quick heads uρ!
    Besides thɑt, excellent website!

  22. Ꮋi therе, I ԁo think your site ϲould bе һaving wweb browser compatibility problеms.
    When І takе a lo᧐k at your site in Safari, it looks fine howeνer whsn opening in Internet Explorer, it’sgot ѕome overlapping issues.

    I jᥙst wanted to provide yοu with a quick heads uρ!
    Besides thɑt, excellent website!

  23. I will immediately snatch your rss as I can’t find your e-mail subscription link or newsletter service. Do you’ve any? Please permit me recognize in order that I may subscribe. Thanks.

    1. Thank you for your comment, Kindly check out the email subscription on the left side of the footer section and sorry for the inconvenience, because the blog is in under construction phase.

  24. I will immediately snatch your rss as I can’t find your e-mail subscription link or newsletter service. Do you’ve any? Please permit me recognize in order that I may subscribe. Thanks.

    1. Thank you for your comment, Kindly check out the email subscription on the left side of the footer section and sorry for the inconvenience, because the blog is in under construction phase.

Leave a Reply

Your email address will not be published.

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

%d bloggers like this: