I have found the Vikas and he is amazing developer, he had always delivered the product under the timeline, on budget and with 100% accuracy, He is totally problem solving guys.
How To send email from xampp localhost ?
comments |
For send email from xampp localhost you need to update these two files.
1.) sendmail.ini
2.) php.ini
Step.1 )
Open sendmail.ini file from your xammp sendmail folder and update its value to
smtp_server=smtp.gmail.com
error_logfile=error.log
debug_logfile=debug.log
auth_username=yourname@gmail.com
auth_password=yourgmailpassword
force_sender=yourname@gmail.com
Note: Please check these lines are not commented(remove ';').
Step.2 )
Open xampp\php\php.ini file find sendmail_path and remove the comment on these lines.
"\"C:\xampp\sendmail\sendmail.exe\" -t".
Step.3 )
Restart your apache server.
Now you can send email from xampp localhost! enjoy :-)
Below the Php mail codes.
<?php
$to = 'ravi.drupalchamp@gmail.com';
$subject = 'Testing Mail';
$message = 'Hello I am testing mail from localhost';
$headers = 'From: ujjwal.drupalchamp@gmail.com'; // here email id is only for show it works from sendmail.ini file
if(mail($to, $subject, $message, $headers)){
print "Mail working well";
}else{
print "Mail not working well";
}
?>
Also Please Turn On this gmail settings.
https://www.google.com/settings/security/lesssecureapps
Add new comment