发送邮件会产生错误 [英] sending a mail produces an error

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

问题描述

你好,

我想通过asp发送邮件.如果我遵循这样的一些教程:

http://forums.asp.net/t/971802.aspx/1/10 [ ^ ]


我收到错误消息:

530 5.7.0必须首先发出STARTTLS命令

有人知道这意味着什么吗?要使程序运行我该怎么办?为了进行测试,我创建了一个我正在使用的Hotmail地址.

谢谢

Hallo,

I want to send a mail thru asp. If I follow some tutorials like this:

http://forums.asp.net/t/971802.aspx/1/10[^]


I get the error message:

530 5.7.0 Must issue a STARTTLS command first

Does anyone know what this means? What do I have to do to make the program run? For testing purposes I created a hotmail address which I''m using.

Thanks

推荐答案

System.Net.Mail.MailMessage obj = new System.Net.Mail.MailMessage();
SmtpClient serverobj = new SmtpClient();
serverobj.Credentials =新的NetworkCredential("anilmeets4u@gmail.com","yourpassword");
serverobj.Port = 587;
serverobj.Host ="smtp.gmail.com";
serverobj.EnableSsl = false;
obj =新的System.Net.Mail.MailMessage();
obj.From = new MailAddress("anilmeets4u@gmail.com","AgileLearning.com",System.Text.Encoding.UTF8);

obj.To.Add(ds.Tables [0] .Rows [i] ["strEmail"].ToString());
obj.Priority = System.Net.Mail.MailPriority.High;
obj.Subject =关于技术问题";
字符串日期= DateTime.Now.ToString();
obj.Body =您的技术问题将在24小时内纠正";
serverobj.Send(obj);
试试这个

问候,

Anilkumar.D
System.Net.Mail.MailMessage obj = new System.Net.Mail.MailMessage();
SmtpClient serverobj = new SmtpClient();
serverobj.Credentials = new NetworkCredential("anilmeets4u@gmail.com", "yourpassword");
serverobj.Port = 587;
serverobj.Host = "smtp.gmail.com";
serverobj.EnableSsl = false;
obj = new System.Net.Mail.MailMessage();
obj.From = new MailAddress("anilmeets4u@gmail.com", "AgileLearning.com", System.Text.Encoding.UTF8);

obj.To.Add(ds.Tables[0].Rows[i]["strEmail"].ToString());
obj.Priority = System.Net.Mail.MailPriority.High;
obj.Subject = "Regarding TechnicalProblem";
string date = DateTime.Now.ToString();
obj.Body = "Your Technical Problem will be Rectified Within 24Hours";
serverobj.Send(obj);
Try this

Regards,

Anilkumar.D


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

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