Jan 14, 2013 at 3:30 PM
Edited Jan 14, 2013 at 3:37 PM
Here is simple flow.
SQL server sends an email using msdb.dbo.sp_send_dbmail to my gmail account.
This MailSystem.NET read that email by IMAP4 from the gmail account.
It seems working fine, but the issue is that..
It always throws exception when initially reading(always very first time) that email from this line..
Message newMessage = inBox.Fetch.MessageObject(n);
--this is exception stack trace-
at ActiveUp.Net.Mail.Parser.ParseMessage(Byte data)
at ActiveUp.Net.Mail.Fetch.MessageObject(Int32 messageOrdinal)
From second time inBox.Fetch.MessageObject,, I don't see any error.
Only thing I can guess would be, basically, sql server uses base64 encoding internally when sending out email...It may cause this issue???....Then strange thing is I don't see this exception from second time. Maybe gmail decoded somehow initially very frist-time
when reading, so mailsystem.net didn't cause any issue when parsing from second-time?
1. I can't find any way to change encoding from sql server mail feature side.
2. I can't rely on this "working" from second-time.
What would be best way to handle this issue?