如何使用asp.net通过电子邮件发送多个附件 [英] How to send multiple attachment by email using asp.net

查看:124
本文介绍了如何使用asp.net通过电子邮件发送多个附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我在报纸出版社工作。我们公司需要通过电子邮件附件发送收据。目前,我们逐个使用报告查看器以pdf格式导出收据。并且pdf文件名是Reportviewer.pdf。我们还需要文件名后跟收据号。喜欢10000.pdf



我的问题是如何在asp.net中发送带附件的多封电子邮件。



请告诉我。



谢谢

解决方案

链接:

http ://www.c-sharpcorner.com/uploadfile/anjudidi/send-multiple-email-at-the-same-time-in-Asp-Net-with-attached-file/ [ ^ ]



http://www.aspdotnet-suresh.com/2014/07/how-to-send-bulk-email-in- aspnet-csharp-with-example.html [ ^ ]

http://www.c-sharpcorner.com/uploadfile/sangeeta92/best-technique-of-sending-bulk-email/ [ ^ ]



http://www.aspsnippets.com/Articles/How-to-send-email-with-Multiple-Attachments-in-ASPNet-Website.aspx [ ^ ]


 Smtp_Server.UseDefaultCredentials =  False  
Smtp_Server.Credentials = Net.NetworkCreden tial( mymail@gmail.com mailPassword
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = smtp .gmail.com
Dim 路径 As String = D:\ filesToMail \
e_mail = MailMessage()
e_mail.From = MailAddress(mymail@gmail.com)
Dim dir As DirectoryInfo(路径)
昏暗 filesInDirectory As FileInfo()= di.GetFiles()
ForEach文件 in filesInDirectory
attach = System.Net.Mail.Attachment(file.FullName)
e_mail.Attachments.Add(attach)
下一步
e_mail。 .Add(txtTo)
e_mail.Subject = txtsubject.Text
e_mail.IsBodyHtml = False
e_mail.Body = txtBody
Smtp_Server.Send(e_mail)


Hi
I am working in Newspaper publishing house. Our company need to send the receipt through email attachment. Currently we export the receipt in pdf format using report viewer one by one. and also pdf file name is Reportviewer.pdf. We also need the file name followed by receipt no. like 10000.pdf

My issue is how to send multiple email with attachment in asp.net.

pls advice me.

Thank you

解决方案

Link:
http://www.c-sharpcorner.com/uploadfile/anjudidi/send-multiple-email-at-the-same-time-in-Asp-Net-with-attached-file/[^]

http://www.aspdotnet-suresh.com/2014/07/how-to-send-bulk-email-in-aspnet-csharp-with-example.html[^]
http://www.c-sharpcorner.com/uploadfile/sangeeta92/best-technique-of-sending-bulk-email/[^]

http://www.aspsnippets.com/Articles/How-to-send-email-with-Multiple-Attachments-in-ASPNet-Website.aspx[^]


Smtp_Server.UseDefaultCredentials = False
       Smtp_Server.Credentials = New Net.NetworkCredential("mymail@gmail.com", "mailPassword")
       Smtp_Server.Port = 587
       Smtp_Server.EnableSsl = True
       Smtp_Server.Host = "smtp.gmail.com"
       Dim path As String="D:\filesToMail\"     
       e_mail = New MailMessage()
       e_mail.From = New MailAddress(mymail@gmail.com)     
       Dim dir As New DirectoryInfo(path)     
       Dim filesInDirectory As FileInfo() = di.GetFiles() 
       ForEach file in filesInDirectory
         attach = New System.Net.Mail.Attachment(file.FullName)
         e_mail.Attachments.Add(attach)
       Next   
       e_mail.To.Add(txtTo)
       e_mail.Subject = txtsubject.Text
       e_mail.IsBodyHtml = False
       e_mail.Body = txtBody   
       Smtp_Server.Send(e_mail)


这篇关于如何使用asp.net通过电子邮件发送多个附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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