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:xamppsendmailsendmail.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,
How are you?";
$headers = "From: myemail06@gmail.com" . "
";
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
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…