I am a website developer using Visual Studio to send a simple contact email from a web page to an email account. Sending the same email to @gmail.com, @yahoo.com, @aol.com and many other hosted email servers there are no issues with the email being delivered or getting spam/junk filtered. However when sent to a @outlook.com email account the email is delivered but always junk filtered. I have sent a test from my Outlook 365 (MS Office 16 desktop install) with the same the smtp server, same user credentials, same to and from address, the same subject and body makes it to the Inbox (not junk filtered). Reviewing the message source the email sent from the web page (localhost) is receiving a SCL: 5 and a PCL:2 while the email send from OS Office Outlook 16 SCL:1 and PCL:2. I have searched all over the web and forums and I cannot find any reason that two incredibly similar emails would have different results.
Can anyone shed some light on what I may be doing wrong to get junk filtered by @outlook.com?
This is the code used to send the email (vb):
Dim eMailmessage As New System.Net.Mail.MailMessage
Dim theHtmlMessage As String
Dim thePlainMessage As String
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("XXX@ABC.com", "XXXXXXXX")
eMailmessage.Subject = "Check out my email message!"
Dim mfrom As New System.Net.Mail.MailAddress("XXX@ABC.com")
eMailmessage.From = mfrom
Dim mTo As New System.Net.Mail.MailAddress("XXXX@outlook.com")
eMailmessage.To.Add(mTo)
theHtmlMessage = "<html><body>This is Html!<br/><br/>This is Html as well!</body></html>"
thePlainMessage = "This is only plain text! No html formatting!"
Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(theHtmlMessage, Nothing, MediaTypeNames.Text.Html)
eMailmessage.AlternateViews.Add(htmlView)
Dim plainTextView As AlternateView = AlternateView.CreateAlternateViewFromString(thePlainMessage, Nothing, MediaTypeNames.Text.Plain)
eMailmessage.AlternateViews.Add(plainTextView)
smtp.Host = "mail.XXXX.com"
smtp.EnableSsl = True
smtp.DeliveryMethod = SmtpDeliveryMethod.Network
smtp.Send(eMailmessage)