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

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 = my-gmail-id@gmail.com
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
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com
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 2018Updated

 

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 = "your-gmail-account@gmail.com"; // 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. ?>
2 1 vote
Article Rating

You may also like

Subscribe
Notify of
guest

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

68 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Chassidy
4 years ago
Noreen Mathern
4 years ago

Only wanna comment that you have a very nice internet site, I like the pattern it really stands out.

Renate
3 years ago

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!

Thomas
3 years ago

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… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Только работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся несравненно объемнее и много эффектно – не должен круг погода тереть глаза при демакияже магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в любой момент дозволительно снять – трите глаза и спите лицом в подушку – не портят свои… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Подобно работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся значительно объемнее и много эффектно – не надобно круг погода тереть глаза быть демакияже магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в всякий момент дозволено снять – трите глаза и спите лицом в подушку – не портят свои… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Подобно работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся много объемнее и весьма эффектно – не должен круг погода тереть глаза при демакияже MAGNET LASHES VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в любой момент можно снять – трите глаза и спите лицом в подушку – не портят приманка… Read more »

Займы онлайн на карту с 18 лет без проверок срочно

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

bit.ly
3 years ago

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… Read more »

Tyree
3 years ago

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?

wholess.com
3 years ago

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!

Muhammad tuaib
3 years ago

really nice article,love you man

Johny Jackson
3 years ago

Hi everyone, it’s my firѕt pay а visit at thіs
site, and paragraph is reɑlly fruitful fօr me,
kep uup posting tһese content.

Andy Jenkin's Kartra
3 years ago

Know your content advertising and marketing viewers.

golfing trips to costa golf

I do not even know how I finished up right here, however I thought this put up was once good.

I do not know who you are however definitely you are going to a well-known blogger in the event you are not already.
Cheers!

wedding services in marbella

It’s wonderful that you are getting thoughts from this article as well as from our
dialogue made here.

https://gruesomeneedforadventure.tumblr.com

Empreendedorismo: Transformando convicções em negócios. https://gruesomeneedforadventure.tumblr.com

property for sale in calahonda

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.

muscle village
3 years ago

Ꮋ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!

Artur
3 years ago

I did all the steps, but it did not work. Can you help me!

removal companies Belfast

Thank you a lot for sharing this with all folks you
really realize what you are speaking about! Bookmarked. Please also
visit my website =). We could have a link alternate
arrangement among us

http://mengancao.vn/gan-nhiem-mo-giai-doan-cuoi-nguy-hiem-khong-2399

Amazing blog! Do you have any recommendations for aspiring writers?

I’m hoping to start my own site soon but I’m a little lost on everything.
Would you recommend starting with a free platform like WordPress or go for a paid option? There are so
many choices out there that I’m totally confused .. Any suggestions?
Appreciate it!

hussain
3 years ago

how can i make the fuction mail inside php can you guide me

Rocco Tennies
3 years ago

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.

Chassidy
4 years ago
Noreen Mathern
4 years ago

Only wanna comment that you have a very nice internet site, I like the pattern it really stands out.

Renate
3 years ago

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!

Thomas
3 years ago

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… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Только работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся несравненно объемнее и много эффектно – не должен круг погода тереть глаза при демакияже магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в любой момент дозволительно снять – трите глаза и спите лицом в подушку – не портят свои… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Подобно работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся значительно объемнее и много эффектно – не надобно круг погода тереть глаза быть демакияже магнитные ресницы VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в всякий момент дозволено снять – трите глаза и спите лицом в подушку – не портят свои… Read more »

TerryFup
3 years ago

Обязательно к просмотру! Подобно работает Magnet Lashes. http://sale2017.magnetlashes.mobi/ Чем хорош Magnet Lashes? MAGNET LASHES VS ОБЫЧНЫЕ НАКЛАДНЫЕ РЕСНИЦЫ – без утомительного наклеивания – гипоаллергенные – без неприятного клея – не раздражают глаза MAGNET LASHES VS ПРИМАНКА РЕСНИЦЫ С ТУШЬЮ – закрепляются намного быстрее, чем наносится тушь – смотрятся много объемнее и весьма эффектно – не должен круг погода тереть глаза при демакияже MAGNET LASHES VS НАРАЩИВАНИЕ В САЛОНЕ – существенно дешевле – смотрятся также – не облетают и не оставляют некрасивые прогалины – в любой момент можно снять – трите глаза и спите лицом в подушку – не портят приманка… Read more »

Займы онлайн на карту с 18 лет без проверок срочно

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

bit.ly
3 years ago

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… Read more »

Tyree
3 years ago

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?

wholess.com
3 years ago

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!

Muhammad tuaib
3 years ago

really nice article,love you man

Johny Jackson
3 years ago

Hi everyone, it’s my firѕt pay а visit at thіs
site, and paragraph is reɑlly fruitful fօr me,
kep uup posting tһese content.

Andy Jenkin's Kartra
3 years ago

Know your content advertising and marketing viewers.

golfing trips to costa golf

I do not even know how I finished up right here, however I thought this put up was once good.

I do not know who you are however definitely you are going to a well-known blogger in the event you are not already.
Cheers!

wedding services in marbella

It’s wonderful that you are getting thoughts from this article as well as from our
dialogue made here.

https://gruesomeneedforadventure.tumblr.com

Empreendedorismo: Transformando convicções em negócios. https://gruesomeneedforadventure.tumblr.com

property for sale in calahonda

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.

muscle village
3 years ago

Ꮋ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!

Artur
3 years ago

I did all the steps, but it did not work. Can you help me!

68
0
Would love your thoughts, please comment.x
()
x