Asp.net身份确认邮件转发垃圾邮件1

时间:2016-03-01 14:58:06

标签: c# asp.net email

我使用asp.net身份注册用户,但确认邮件转到垃圾邮件而不是收件箱: enter image description here

另外正如你所看到的那样,当我不发送任何内容时,图像不会显示... 这是我的代码:

   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);
        }

2 个答案:

答案 0 :(得分:0)

这条消息很清楚。

  

它包含垃圾邮件中通常使用的内容

您应该尝试对邮件和主题内容进行更改

答案 1 :(得分:0)

我只是改变主题='აქტივაცია'主题=激活和问题已经解决。但我有utf-8编码,为什么会发生这种情况?