如何发送电子邮件?
我有一个这样的数据表。
我有一张这样的Excel表格。现在我正在读取其中的数据并转换为如下数据表:
id Name MailID Body
123 kirna [email protected] happy birthday
234 ram [email protected] happy birthday
345 anu [email protected] how is the day going
357 rashmi [email protected] work need to be completed
现在我要向上述所有人员发送电子邮件。
任何人都可以帮助我如何从数据表中读取数据并向他们发送邮件,其中包含指定的正文。
任何帮助都会很棒。
谢谢。
I have an datatable like this.
I have an Excel sheet like this. Now I am reading the data from that and converting into an datatable like this:
id Name MailID Body
123 kirna [email protected] happy birthday
234 ram [email protected] happy birthday
345 anu [email protected] how is the day going
357 rashmi [email protected] work need to be completed
Now I to send email to all the above person.
Can any one help me how I can read data from datatable and send mail to them with the body what is been specified.
Any help would be great.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
类:
您可以使用 SmtpClient :在.NET 4.0中, SmtpClient 实现IDisposable,因此请确保正确处置它。
备注2:有一个SmtpClient 类无法正确将
QUIT
命令发送到 SMTP 服务器。You could use the SmtpClient class:
Remark1: In .NET 4.0, SmtpClient implements IDisposable, so make sure to properly dispose it.
Remark2: There's a bug in SmtpClient class prior to .NET 4.0 which doesn't properly send the
QUIT
command to the SMTP server.您可以从数据库发送电子邮件。这些文章可能对您有帮助。
http://msdn.microsoft.com/en-us/library/ms190307。 .aspx
http://msdn.microsoft.com/en-us/library/ms189505。 ASPX
You can send email from Data base .These articles might help you .
http://msdn.microsoft.com/en-us/library/ms190307.aspx
http://msdn.microsoft.com/en-us/library/ms189505.aspx