How to configure XAMPP to send mail from localhost?

How to configure XAMPP to send mail from localhost?

 

You can send mail from localhost with sendmail package , sendmail package is inbuild 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.

 

STEPS

1

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

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”
3

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

[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
4

ESPECIALLY For gmail please check https://support.google.com/accounts/answer/6010255 to allow access from less secure apps

SO AS GMAIL TO WORK IN THIS CASE… OTHER THAN GMAIL MAY OR MAY NOT HAVE [SIMILAR] SECURITY NEEDED SETUP.
5
Now you have done!! create php file with mail function and send mail from localhost.

PS: don’t forgot 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.
6

For example comment following line if there is another sendmail_path : sendmail_path=”C:\xampp\mailtodisk\mailtodisk.exe” in the php.ini file

7
Also remember to restart the server using the XAMPP control panel so the changes take effect.

I can provide sample working XAMPP php.ini & sendmail.ini – download and compare if you have problems sending email….with XAMPP using gmail… cost 5$ [PayPal] send email to mymac@poliscarhire.com and lsepolis123@gmail.com …

 

Send email SAMPLE scripts:

PLAIN PHP – SEND EMAIL STATEMENTS

<?php

$email = "USERNAME3@gmail.com";

$to = "{$email}"; 

$subject = "Inquiry Contact Us from ". $email;

$headers = "From:USERNAME@gmail.com";

$headers .= "\r\nBcc:USERNAME2@gmail.com";

$headers .= "\r\nReply-To:{$email}";

$headers .= "\r\nContent-Type: text/html; charset=UTF-8";

$headers .= "\r\nMIME-Version: 1.0";

mail($to,$subject,"test",$headers);

CAKEPHP – Controller

<?php

....

public function emailtothis() {
 $email1 = $this->request->data('emailfield');
 $id = $this->request->data('idemail');
 
 $listing = $this->Listings->get($id, [
 'contain' => ['Users', 'Categories']
 ]);
 
 $txt="";
 foreach ($listing as $key => $value) {
 $txt.="{$key} : {$value} , ";
 }
 
 $email = new Email('default');
 $email->from(['USERNAME@gmail.com' => 'Polis.town'])
 ->to($email1)->emailFormat('html')
 ->subject($listing->name." - Polis.town")
 ->send('Share from Polis.town... <br/><br/>' 
 . $listing->name . '<br/>' . $listing->address . '<br/>'
 . (($listing->tel !="")?('<a href="tel:00357'.$listing->tel.'">'.$listing->tel.'</a>'):('')) .'<br/>' 
 . (($listing->telMob !="")?('<a href="tel:00357'.$listing->telMob.'">'.$listing->telMob.'</a>'):('')) .'<br/>' 
 . (($listing->email!="") ? ('<a href="mailto:'.$listing->email.'">'.$listing->email.'</a>') : ('' )).'<br/>' 
 . (($listing->url!="") ? ('<a href="'.$listing->url.'">'.$listing->url.'</a>') : ( '' )) .'<br/>'.'<br/>' 
 . $listing->description.'<br/><br/>'
 . 'long: '. $listing->long.', lat: '.$listing->lat); 
 /* */
 //die($email1.", ".$listing->url);
 return $this->redirect('/listings/view/'.$id);
 
 }

CODEIGNITER – Controller

<?php

...

   public function sendemail(){

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

        $this->email->from('USERNAME@cytanet.com.cy', 'lse');

        $this->email->to('USERNAME@gmail.com');

        $this->email->cc('USERNAME2@gmail.com');

        $this->email->bcc('USERNAME3@hotmail.com');

        $this->email->subject('Email Test');

        $this->email->message('Testing the email class.');

        $this->email->send();

        die("email sent");

    }

My new 15″ Mac Book Pro 2016

My new 15′ Mac Book Pro 2016 – Unboxing & Review
(MBP 2016 & Accessories)

==============================

I definitely recommend use/read manual prior using your new Mac… I also turned off File Vault [is turned Off by default – but by error activated it] for a little more faster usage of the MBP.

here are some extracts from manual….

2017-01-25_23-34-02_mbp2

2017-01-25_23-38-04_mbp3

2017-01-25_23-32-40_mbp1

Ordering accessories procedure I followed….

Amazon.com [US]  >>>  MyUS.com [FL, US Forward address]  >>>  Europe [My Home]

myUS.com

MyUS: Free 1 Month Membership + 20% off your 1st Shipment!

This Blog Post Coming Soon!!!

 

 

Mac Book Pro 2016 Accessory : usb c hub
usb c hub
aukey usb c hub
aukey usb c hub

 

samsung t3 ssd
samsung t3 ssd
Mac Book Pro 2016 Accessory : mbp2016_sleeve
mbp2016 sleeve

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[embedyt]https://youtu.be/iJdbwZrnE9I[/embedyt]


Buy from Amazon

http://amzn.to/2iUm7JT   aukey hub

http://amzn.to/2iOdrUK   Samsung T3 ssd

http://amzn.to/2iUgfQT   hub hdmi

http://amzn.to/2i4Uj4h   sleeve case

Shipping address in Amazon put your MyUS.com forward address MyUS: Free 1 Month Membership + 20% off your 1st Shipment!

After all items delivered to Forward address

Request shipment to you eg Europe or Africa …

 


Amazon Order History – Last 6 mos

 

MyUS Box/Suite (Fwd Address from US, FL => To me Europe) Prior Ship it to me!

 

MyUS Box/Suite After Ship it to me!

 

Unboxing Accessories

 

Unboxing MBP 2016 15″