PHP Mailer Not Sending Email To Office365 -


i want send mail office365 using phpmailer not sending , giving me connect() error here code:

email , password i'm using in real code working

require 'mailer/phpmailerautoload.php'; $mail = new phpmailer(); $mail->issmtp(); $mail->mailer = 'smtp'; $mail->smtpauth = true; $mail->host = 'smtp.office365.com'; // "ssl://smtp.gmail.com" didn't worked $mail->port = 587; $mail->smtpsecure = 'tls'; // or try these settings (worked on xampp , wamp): // $mail->port = 587; // $mail->smtpsecure = 'tls';   $mail->username = "email"; $mail->password = "password";  $mail->ishtml(true); // if going send html formatted emails $mail->singleto = true; // if want send same email multiple users. multiple emails sent one-by-one.  $mail->username = "mail@gmail.com"; $mail->fromname = "your name";  $mail->addaddress("abc@gmail.com","user 1");   $mail->subject = "testing phpmailer localhost"; $mail->body = "hi,<br /><br />this system working perfectly.";  if(!$mail->send()) {     echo "message not sent <br />phpmailer error: " . $mail->errorinfo; } else{     echo "message has been sent"; } 

the output is

message not sent phpmailer error: smtp connect() failed. https://github.com/phpmailer/phpmailer/wiki/troubleshooting


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -