I want to use the mail() function from my localhost. I have WAMP installed and a Gmail account. I know that the SMTP for Gmail is smtp.gmail.com and the port is 465 (more info from gmail). What I need to configure in WAMP so I can use the mail() function?
Thanks!!
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.
We can send mail from our localhost using some mail configuration by XAMPP/LAMP/WAMP server, First we need to enable php_openssl php extensions from php. ini file. I am using GMAIL SMTP server to send mail from localhost and sendmail package,It is a mail transport agent which can be found in php.
Gmail servers use SMTP Authentication under SSL or TLS. I think that there is no way to use the mail()
function under that circumstances, so you might want to check these alternatives:
They all support SMTP auth under SSL.
You'll need to enable the php_openssl
extension in your php.ini.
Additional Resources:
PEAR::Mail
)Nette\Mail
I've answered that here: (WAMP/XAMP) send Mail using SMTP localhost (works not only GMAIL, but for others too).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With