Although I am successfully able to fetch folders and messages for my Outlook email accounts, I discovered that I am unable to send messages.
When I first encountered the problem, I went into the terminal and tried to connect to the server by doing:
openssl s_client -starttls smtp -crlf -connect smtp-mail.outlook.com:587
This was successful. My smtp session settings matched the above request:
self.smtpSession = [[MCOSMTPSession alloc] init];
self.smtpSession.hostname = smtp-mail.outlook.com;
self.smtpSession.port = 587;
self.smtpSession.username = [email protected];
self.smtpSession.connectionType = MCOConnectionTypeStartTLS;
self.smtpSession.password = nil;
self.smtpSession.OAuth2Token = (same token as is working for imap session);
self.smtpSession.authType MCOAuthTypeXOAuth2;
self.smtpSession.checkCertificateEnabled = NO;
The first error I received was:
2014-03-12 16:49:01.107 MailApp[9748:60b] sendOutboxEmail error:Unable to authenticate with the current session's credentials.
Next, I tried changing the smtpSession.connectionType to MCOConnectionTypeTLS. This change yielded a different error:
2014-03-12 16:44:01.049 MailApp[9531:99cf] CFNetwork SSLHandshake failed (-9800)
2014-03-12 16:44:03.610 MailApp[9531:60b] sendOutboxEmail error:A stable connection to the server could not be established.
My smtp session connection logger for the first attempt using the startTLS connection printed:
MCOSMTPSession: [-1]
2014-03-12 16:48:20.363 MailApp[9748:3f1b] MCOSMTPSession: [0] 220 BLU0-SMTP305.phx.gbl Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Wed, 12 Mar 2014 13:48:20 -0700
2014-03-12 16:48:20.364 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.364 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.364 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.365 MailApp[9748:3f1b] MCOSMTPSession: [1] EHLO droga5-180.home
2014-03-12 16:48:20.365 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.365 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.431 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.431 MailApp[9748:3f1b] MCOSMTPSession: [0] 250-BLU0-SMTP305.phx.gbl Hello [108.41.27.139]
250-TURN
250-SIZE 41943040
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-TLS
250-STARTTLS
250 OK
2014-03-12 16:48:20.432 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.432 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.432 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.433 MailApp[9748:3f1b] MCOSMTPSession: [1] STARTTLS
2014-03-12 16:48:20.433 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.433 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.703 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.704 MailApp[9748:3f1b] MCOSMTPSession: [0] 220 2.0.0 SMTP server ready
2014-03-12 16:48:20.704 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.704 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.908 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.908 MailApp[9748:3f1b] MCOSMTPSession: [1] EHLO user-180.home
2014-03-12 16:48:20.909 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.909 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.944 BirdseyeMail[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.944 MailApp[9748:3f1b] MCOSMTPSession: [0] 250-BLU0-SMTP305.phx.gbl Hello [108.41.27.139]
250-TURN
250-SIZE 41943040
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-AUTH LOGIN PLAIN XOAUTH2
250 OK
2014-03-12 16:48:20.945 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.945 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.945 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.946 MailApp[9748:3f1b] MCOSMTPSession: [1] AUTH XOAUTH2 dXNlcj1qY2xhcms3Nzc2QG91dGxvb2suY29tAWF1dGg9QmVhcmVyIEV3QkFBcTFEQkFBVUdDQ1hjOHdVL3pGdTlRbkxkWlh5K1luRWxGa0FBVlVnaDhDVzJTN25NTzBCaHRjM1l2ZlRiMXdYWWdsZHVPeWFpZzB3VFhCUUpNSWJTV2FIdkEvTnNBTnRyS0l0ZUpPMU5Ibm96b1drU3Q5WXkwOStkKzJsL3FSNW8wU01QNjFYQktvL2ZrN2puSlNOMklwWWs2bTZRQVNNRU1Uc20rYVg0Y0F5RDhZV3BkZzEvM21pTlBkSVVVMmNaYi8xUUtPM3Fpd25Qb2pBalVsdVJlSlhzOCtneURRSjlYSVVrRXJhdkdpN0VJUWRxWm55dE1Fem9TdkkzQmF3WVJ6amxYOWxST0ppTnFFWlVwVER5cHhtN2NobGtRNnVrMlZhbGhHVFYyK1REcjJqNFVUbFZtMGtsRWUyTTNHNU41R1c4YnFoUUM
2014-03-12 16:48:20.946 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:20.946 MailApp[9748:3f1b] MCOSMTPSession: [-1]
2014-03-12 16:48:50.948 MailApp[9748:3f1b] MCOSMTPSession: [4]
2014-03-12 16:49:01.107 MailApp[9748:60b] sendOutboxEmail error:Unable to authenticate with the current session's credentials.
2014-03-12 16:49:32.113 MailApp[9748:b80f] MCOSMTPSession: [-1]
2014-03-12 16:49:32.113 MailApp[9748:b80f] MCOSMTPSession: [1] QUIT
2014-03-12 16:49:32.113 MailApp[9748:b80f] MCOSMTPSession: [-1]
2014-03-12 16:49:32.114 MailApp[9748:b80f] MCOSMTPSession: [-1]
2014-03-12 16:49:32.114 MailApp[9748:b80f] MCOSMTPSession: [5]
Do you have any thoughts on why this might be happening? Thanks.