0

Is there anyway to send email via gmail (or other free provider) in php.
But I want to use php built in mail() function.

This solution is only for dev and staging.

Thanks

SexyMF
  • 10,657
  • 33
  • 102
  • 206
  • possible duplicate of [How to configure WAMP (localhost) to send email using Gmail?](http://stackoverflow.com/questions/600725/how-to-configure-wamp-localhost-to-send-email-using-gmail) – Shef Oct 01 '11 at 06:52

2 Answers2

1

You can, using PHPMailer. And also check here to know details you should provide in your script so that you be able to send using Gmail SMTP.

Source

Plenty of walk-throughs and pre-made scripts/classes if you just used google. Unless you want to make yours from scratch.

M. Suleiman
  • 858
  • 4
  • 22
0

If you don't want to use libraries but still want to send email via gmail, you have to setup SMTP server which sends email via Gmail. One very easy alternative is SSMTP. Setting up SSMTP is very easy. http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/

Hope it helps.

Mahbub
  • 3,108
  • 24
  • 29