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

XAMPP Sendmail using Gmail account

$
0
0

I'm trying to configure Sendmail through XAMPP to send email. In my sendmail.ini I have these settings:

# Set default values for all following accounts.

logfile "C:\xampp\sendmail\sendmail.log
account Gmail
tls on
port 587
tls_certcheck off
host smtp.gmail.com
from myemail@gmail.com
auth on
user myemail06@gmail.com
password mypassword

account default : Gmail

I've created a test script like this:

$to = "testemail@btinternet.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = "From: myemail06@gmail.com" . "\r\n";
if (mail($to, $subject, $body, $headers)) {
    echo ("Message successfully sent!");
} else {
    echo ("Message delivery failed...");
}

I get a message to say that the email was sent but it never arrives and in the logs I get:

sendmail: Error during delivery: Must issue a STARTTLS command first.

Does anybody know what the issue could be here?

Thanks in advance!

Gaz


Viewing all articles
Browse latest Browse all 29758

Trending Articles



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