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
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.
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.
精彩评论