开发者

Mail arrives in spam

开发者 https://www.devze.com 2022-12-18 09:54 出处:网络
I\'m using this code for sending mails. But these mails arrive in spam folder. MailMessage message = new MailMessage();

I'm using this code for sending mails. But these mails arrive in spam folder.

MailMessage message = new MailMessage();

message.From = new MailAddress(ConfigurationSettings.AppSettings["From"]);
message.To.Add(new MailAddress(ConfigurationSettings.AppSettings["To"]));
message.Subject = Configurat开发者_运维问答ionSettings.AppSettings["Title"];
message.Body = ConfigurationSettings.AppSettings["Body"];

SmtpClient client = new SmtpClient();
client.Send(message);

Why? How can i do?

thank


You may need to set up a Sender Policy to convince the recievers email service that you are who you cailm to be.


Looks innocent from the code part. Check the contents of your fields from the configuration. One of them has to contain something which triggers the spam-detection on the receiver-side. You cannot decide from the sender-side in which folder a mail arrives, that's completely receiver-side logic.


Try to include aditional header like the "X-Mailer" and authenticate with a SMTP server.. :)


View the headers of the sent message. Some times spam checking software will provide hints (spam assasin does) of why your message is marked as spam.

If you don't understand them, post those headers here, and we can take a look at them.


Try by Giving High Priority to the sending mail. it may reach to inbox instantly

message.Priority = MailPriority.High;
0

精彩评论

暂无评论...
验证码 换一张
取 消