I am attempting to set up PHPMailer so that one of our clients is able to have the automatically generated emails come from their own account. I have logged into their Office 365 account, and found that the required settings for PHPMailer are:
Host: smtp.office365.com
Port: 587
Auth: tls
I have applied these settings to PHPMailer, however no email gets sent (The function I call works fine for our own mail, which is sent from an external server (Not the server serving the web pages)).
"host" => "smtp.office365.com",
"port" => 587,
"auth" => true,
"secure" => "tls",
"username" => "clientemail@office365.com",
"password" => "clientpass",
"to" => "myemail",
"from" => "clientemail@office365.com",
"fromname" => "clientname",
"subject" => $subject,
"body" => $body,
"altbody" => $body,
"message" => "",
"debug" => false
Does anyone know what settings are required to get PHPMailer to send via smtp.office365.com?
See Question&Answers more detail:os