Tohid
Tohid

Reputation: 22573

Emails are missing Message-Id in the header

I am writing a windows service that sends reminder emails to some of our customers. Eventually I made it to work, then I noticed that the emails are going to the spam folder. I used the spamscorechecker.com score tool and I found out that my emails are considered as a spam because they are missing the Message-Id in their header ! If I'm not mistaken, message-id should be attached to the email on the smtp server. I don't know why the server is not doing it for the emails that are sent from the program, but apparently it does do it for those that are sent from our mail client or the webmail ! I was thinking that maybe there is something I need to do in my code to ask for it or maybe there is something wrong with my smtp settings in App.config here is my SMTP settings in App.config :

<system.net>
    <mailSettings>
      <smtp from="Reminder &lt;reminder@myserver.com&gt;">
        <network host="mail.myserver.net" port="587" password="my password" userName="reminder@myserver.com"/>
      </smtp>
    </mailSettings>
  </system.net>

does it have anything to do with the authentication ?

Upvotes: 1

Views: 8526

Answers (1)

S P
S P

Reputation: 4643

I don't know if assigning a message-id gives you any guarantee that your message won't be treated as spam, but perhaps it might help a little bit, but you can set it using the Headers-property:

  mailMessage.Header.Add("message-id", "123556677000");  

More effective way will be sending a mail-certificate along with your e-mail message. Mail-certificates will cost you perhaps 20-30 bucks a year.

Upvotes: 1

Related Questions