I am using asp.net identity for registering users, but confirmation mails going to spam instead of inbox:
Also as you can see it says Images are not displayed while i am not sending any... Here is my code :
public Task SendAsync(IdentityMessage message)
{
string html = message.Body;
string plain = message.Body;
MailMessage msg = new MailMessage();
msg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(html, new ContentType("text/html")));
msg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(plain, new ContentType("text/plain")));
msg.From = new MailAddress("no-reply@leavingstone.net", "nebula");
msg.To.Add(message.Destination);
msg.IsBodyHtml = true;
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.Subject = "აქტივაცია";
new SmtpClient("smtp.mandrillapp.com")
{
Port = 25,
Credentials = ((ICredentialsByHost)new NetworkCredential("xxx"))
}.Send(msg);
return Task.FromResult(0);
}
Well the message is pretty clear.
It contains content that's typically used in spam messages
You should try to make changes in message and subject content
I've just change subject ='აქტივაცია' to subject = activation and problem has been solved. But i had utf-8 encoding and why that thing happens?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.