Page 1 of 1

How to send email from xampp to gmail

Posted: Mon Sep 16, 2013 7:59 am
by sudhir.gadiraju
Hi guys. I just want to know how to send email from my php mail() function in my index.php. I made all the modifications in the php.ini file and sendmail.in. But all in vain.

My sendmail.in file contains:
------------------------------------
smtp_server=smtp.gmail.com
smtp_port=465 (tried 587 and 25)
smtp_ssl=ssl (tried auto also)
error_logfile=error.log
auth_username=sudhir.gadiraju@gmail.com
auth_password=my gmail account password
force_sender=sudhir.gadiraju@gmail.com

My php.in [mail function] contains
-------------------------------------
SMTP = smtp.gmail.com
smtp_port = 465 (tried 587 and 25)
sendmail_from = sudhir.gadiraju@gmail.com
sendmail_path = "\"\xampp\sendmail\sendmail.exe\" -t"

My php index.php conatins the following code:

<?php
mail('sudhir.gadiraju@gmail.com', 'Hello', 'This is a test email', 'From:noreply@gmail.com');
?>

Any ideas please help. Thanks in advance.