php.ini code
SMTP = smtp.gmail.com ; http://php.net/smtp-port smtp_port = 587 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = praveenk60@gmail.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
sendmail.ini code
# Mercury #account Mercury #host localhost #from postmaster@localhost #auth off # A freemail service example #account Hotmail #tls on #tls_certcheck off #host smtp.live.com #from [exampleuser]@hotmail.com #auth on #user [exampleuser]@hotmail.com #password [examplepassword] account Gmail tls on tls_certcheck off host smtp.gmail.com from praveenkd1@gmail.com auth on user praveenk60@gmail.com password ********** account default : Gmail port=58
My PHP Code is as follows
<?php
$to = "praveenk@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("Message successfully sent!");
} else {
echo("Message delivery failed");
}
?>
Please help me.
Thanks in advance
This post has been edited by Jstall: 18 February 2012 - 01:13 PM
Reason for edit:: Added code tags, when posting code please use [ code] tags

New Topic/Question
Reply



MultiQuote






|