I am trying to send mail from localhost. but i am unable to send the mail from localhost so can anybody tell me that how to reconfigure my xampp to send mail from localhost
This code is used for the mail from your localhost XAMPP and your Gmail account. This code is very easy and working for me try your self.
Below Change In php.ini File
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = your@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
extension=php_openssl.dll
Below Change In sendmail.ini File
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=yourmail@gmail.com
auth_password=your-gmail-password
force_sender=yourmail@gmail.com
Please write the belove code in your PHP file to send email
';
$message .= '';
$message .= '';
$message .= "Name: Details ";
$message .= "Email: Details ";
$message .= "Type of Change: Details ";
$message .= "Urgency: Details ";
$message .= "URL To Change (main): Details ";
$addURLS = 'google.com';
if (($addURLS) != '') {
$message .= "URL To Change (additional): " . $addURLS . " ";
}
$curText = 'dummy text';
if (($curText) != '') {
$message .= "CURRENT Content: " . $curText . " ";
}
$message .= "NEW Content: New Text ";
$message .= "
";
$message .= "