Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29767

I am attempting to send emails with the mail function in php via localhost (XAMPP) however the email is not sending. How do I achieve it? [duplicate]

$
0
0

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...";}

Viewing all articles
Browse latest Browse all 29767

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>