cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

office 356 email with swiftmailer in PHP

I am trying to send mail from office 365 email by my php web app but errors r showned. Differrent config has different errors. Here are the ones:

'host' => 'smtpout.secureserver.net',
'username' => ‘myemail@myemail.com’,
'password' => ‘mypw’,
'port' => '465', // 25 and 80 are the same result
'encryption' => ‘ssl’,

Error: Expected response code 250 but got code "", with message "" . . .
———

'host' => 'smtp.office365.com',
'username' => ‘myemail@myemail.com’,
'password' => ‘mypw’,
'port' => '587',

Error: Expected response code 250 but got code "530", with message "530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [SGxxxxxxxxxxxx8.apcprd03.prod.outlook.com]

—————

'host' => 'smtp.office365.com',
'username' => ‘myemail@myemail.com’,
'password' => ‘mypw’,
'port' => '587',
'encryption' => 'tls'

Error: Expected response code 250 but got code "554", with message "554 5.2.0 STOREDRV.Submission.ExceptionSmiley FrustratedendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message...

What is the problem with it?