在MVC中进行电子邮件验证时,我收到以下错误: - 邮箱不可用。服务器响应为:5.7.3请求的操作中止;用户未经过身份验证 [英] At the time of email verfication in MVC I am getting following error : - mailbox unavailable. The server response was: 5.7.3 requested action aborted; user not authenticated

查看:159
本文介绍了在MVC中进行电子邮件验证时,我收到以下错误: - 邮箱不可用。服务器响应为:5.7.3请求的操作中止;用户未经过身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我正在做smtp第一次在mvc进行电子邮件验证



i不要我错在哪里





当我注册它时显示我的错误: -

here i am doing smtp first time for email verification in mvc

i dont no where i am wrong


when i register it shows me this error :-

Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated





这是我的留言服务文件





here is my message service file

public async static Task SendEmailAsync(string email, string subject, string message)
      {
          try
          {
              var _email = "erjoshi@outlook.com";
              var _epass = ConfigurationManager.AppSettings["Emailpassword"];
              var _dispName = "HimanshuJoshi";
              MailMessage myMessage = new MailMessage();
              myMessage.To.Add(email);
              myMessage.From = new MailAddress(_email, _dispName);
              myMessage.Subject = subject;
              myMessage.Body = message;
              myMessage.IsBodyHtml = true;

              using (SmtpClient smtp = new SmtpClient())
              {
                  smtp.EnableSsl = true;
                  smtp.Host = "smtp.live.com";
                  smtp.Port = 587;
                  smtp.UseDefaultCredentials = false;
                  smtp.Credentials = new NetworkCredential(_email, _epass);
                  smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                  smtp.SendCompleted += (s, e) => { smtp.Dispose(); };
                  await smtp.SendMailAsync(myMessage);
              }
          }
          catch (Exception ex)
          {

              throw ex;
          }





我尝试过:



i在这里添加了我的电子邮件地址



看到这个错误后我错了一些在这里这个smtp代码的地方我不知道我错在哪里



What I have tried:

i have added my email address here

after seeing this error i thing i am wrong some where here in this smtp code i dont know exectly where i am wrong

推荐答案

要检查的事情:



1.确保你的电子邮件地址是erjoshi@outlook.com,而不是erjoshi@hotmail.com



2.检查帐户是否启用了双因素身份验证/两步验证,如果是,你需要设置一个应用密码



3.打开另一个Hotmail / outlook帐户并使用它进行测试以消除任何疑问:)
Couple of thing to check:

1. make sure your email address is erjoshi@outlook.com, and not erjoshi@hotmail.com

2. Check if the account has two factor authentication/two step verification enabled, if yes, you need to set up an app password

3. Open another Hotmail/outlook account and use it for testing to eliminate any doubt :)


这篇关于在MVC中进行电子邮件验证时,我收到以下错误: - 邮箱不可用。服务器响应为:5.7.3请求的操作中止;用户未经过身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆