|So you have the correct SMTP Server - smtp.office365.com and correct Port - 587, what Encryption are you using?
Microsoft says to use TLS and I bet Outlook is set to use it but have you set it in your code?
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004