SMTP服务器需要安全连接或客户端未经过身份验证。该 [英] The SMTP server requires a secure connection or the client was not authenticated. The

查看:147
本文介绍了SMTP服务器需要安全连接或客户端未经过身份验证。该的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net中提交表单时出现此错误,C#后面的代码。

这个错误是什么意思,

我的错是什么? />
可以任意一个回复???

this error is occuring while am submitting form in asp.net,code behind C#.
what is the meaning of this error,
what is my fault
can any one reply???

推荐答案

您是否传递了正确的参数,即域名,用户名,密码,smtp端口号等等?


为什么不在这里发布您的代码段,调试代码会容易得多。小心:)
Are you passing proper parameters, i.e. domain name, username, password, smtp port number and so on?

Why not post your code segment here, it will be much easier to debug your code. Take care :)


这是我的代码。

这里有什么问题???????????



private void EmailAccountInformation()

{

try

{

int port = 587; //使用465还

string userName =" zionrealtors@gmail.com" ;;

string password =" zion * 123#" ;;


MailMessage message = new MailMessage();

message.From = new MailAddress(" admin@zionrealtors.com");

string MailId = txtMemEmailId.Text;

ViewState [" email"] = MailId;

message.To.Add(new MailAddress(MailId.ToString())) ;

//message.To.Add("immanuelseeni@yahoo.com,mohideen84 @ yahoo.co.in");


message.Subject =帐户信息;

message.IsBodyHtml = t rue;

string msgbody ="感谢您加入ZionRealtors,< br>< br>请记住您的注册信息:< br>< br>< font color = blue size = + 1> EmailId:" + MailId +"< br>密码:" + txtMemPassword.Text +"< / font>" ;;

message.Body = msgbody;


SmtpClient smtp = new SmtpClient(" smtp .gmail.com",port);

smtp.Credentials = new System.Net.NetworkCredential(userName,password);

smtp.EnableSsl = true;

smtp.Send(message);
This my code.
what is wrong here???????????


private void EmailAccountInformation()
{
try
{
int port = 587;//use 465 also
string userName = "zionrealtors@gmail.com";
string password = "zion*123#";

MailMessage message = new MailMessage();
message.From = new MailAddress("admin@zionrealtors.com");
string MailId = txtMemEmailId.Text;
ViewState["email"] = MailId;
message.To.Add(new MailAddress(MailId.ToString()));
//message.To.Add("immanuelseeni@yahoo.com,mohideen84 @yahoo.co.in");

message.Subject = "Account Info";
message.IsBodyHtml = true;
string msgbody = "Thanks for joining ZionRealtors,<br><br>Please memory your registration infos:<br><br><font color=blue size=+1>EmailId: " + MailId + "<br>Password: " + txtMemPassword.Text + "</font>";
message.Body = msgbody;

SmtpClient smtp = new SmtpClient("smtp.gmail.com", port);
smtp.Credentials = new System.Net.NetworkCredential(userName, password);
smtp.EnableSsl = true;
smtp.Send(message);


private void EmailAccountInformation()

{

try

{

int port = 587; //使用465还

string userName =" zionrealtors@gmail.com" ;;

string password =" zion * 123#";


MailMessage message = new MailMessage();

message.From = new MailAddress(" admin@zionrealtors.com");

string MailId = txtMemEmailId.Text;

ViewState [" email"] = MailId;

message.To.Add(new MailAddress(MailId.ToString()));

//message.To.Add("immanuelseeni@yahoo.com,mohideen84 @ yahoo.co.in& quot;) ;


message.Subject ="帐户信息" ;;

message.IsBodyHtml = true;

string msgbody ="感谢您加入ZionRealtors,< br>< br>请记住您的注册信息:< br>< br>< font color = blue size = + 1> EmailId:" + MailId +"< br>密码:" + txtMemPassword.Text +"< / font>" ;;

message.Body = msgbody;


SmtpClient smtp = new SmtpClient(" smtp .gmail.com",port);

smtp.Credentials = new System.Net.NetworkCredential(userName,password);

smtp.EnableSsl = true;

smtp.Send(message);
private void EmailAccountInformation()
{
try
{
int port = 587;//use 465 also
string userName = "zionrealtors@gmail.com";
string password = "zion*123#";

MailMessage message = new MailMessage();
message.From = new MailAddress("admin@zionrealtors.com");
string MailId = txtMemEmailId.Text;
ViewState["email"] = MailId;
message.To.Add(new MailAddress(MailId.ToString()));
//message.To.Add("immanuelseeni@yahoo.com,mohideen84 @yahoo.co.in");

message.Subject = "Account Info";
message.IsBodyHtml = true;
string msgbody = "Thanks for joining ZionRealtors,<br><br>Please memory your registration infos:<br><br><font color=blue size=+1>EmailId: " + MailId + "<br>Password: " + txtMemPassword.Text + "</font>";
message.Body = msgbody;

SmtpClient smtp = new SmtpClient("smtp.gmail.com", port);
smtp.Credentials = new System.Net.NetworkCredential(userName, password);
smtp.EnableSsl = true;
smtp.Send(message);


这篇关于SMTP服务器需要安全连接或客户端未经过身份验证。该的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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