发送电子邮件失败 [英] Sending email failed

查看:105
本文介绍了发送电子邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手请帮我解决这个问题我必须从我自己的电子邮件发送消息。



错误是:



SMTP服务器需要安全连接或客户端未经过身份验证。服务器响应为:5.5.1需要身份验证。了解更多信息



我尝试过:



i am new in programming please help me to solve this problem i have to send a message from and to my own email.

The error is:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

What I have tried:

SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
            MailMessage mm = new MailMessage("musafirbalti@gmail.com", "musafirbalti@gmail.com");
            mm.Subject = "abc";
            mm.Body = "ansdjfskhfsa d fjk h sjh  sdhf hskd";
            smtp.Credentials = new System.Net.NetworkCredential("mymail@gmail.com", "mypasword");
            smtp.EnableSsl = true;
            smtp.Send(mm);
            TextBox1.Text = "the email is been sended to the reciver";

推荐答案

Gmail SMTP端口(SSL): 465

请参阅:什么是Gmail SMTP服务器设置? [ ^ ]
Gmail SMTP port (SSL): 465
See: What Are the Gmail SMTP Server Settings?[^]


您首先检查您的Gmail帐户是否有两步验证是否开启。如果是,则必须关闭两步验证
You first check your gmail account has two steps verification is on or not. If on then you must off two steps verification.


这篇关于发送电子邮件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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