How would I send an email using the mail function on php with localhost(xampp)?My php.ini file is:
SMTP = smtp.gmail.com smtp_port = 465 sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"sendmail_from = senders email
My sendmail.ini file is:
smtp_server=smtp.gmail.comsmtp_port=465 error_logfile=error.logdebug_logfile=debug.logauth_username=email addressauth_password=passwordforce_sender=sender's email
My code is:
$to_email = "email address";$subject = "Subject";$body = "msg";$headers = "From: email address";if (mail($to_email, $subject, $body, $headers)) { echo "Email successfully sent to $to_email...";} else { echo "Email sending failed...";}