Cannot send emails through office 365 SMTP

I finally got this working.

The answers can be found here SMTP configuration for Office 365