发送LINQ列表中的多个附件的电子邮件
本文关键字:电子邮件 列表 发送 LINQ | 更新日期: 2023-09-27 18:23:59
这对你来说可能很简单,大师,但我对此感到困惑。我有一个方法,将收集所有信息的电子邮件,然后通过outlook发送出去。但是,我想说明多个附件。我该怎么做?我需要在方法头中更改什么?
public static void sendOutlookMail(string toAddress, string emailSubject, string ccAddress = null, string emailAttachment = null, string emailBody = null)
我知道我必须更改,但不确定要更改什么,并保留一个默认值:
string emailAttachment = null
提前谢谢。
如果你需要更多的细节,请告诉我。
如果你想传递字符串列表,你可以替换它:
string emailAttachment = null
这个:
List<string> emailAttachment = null
理想情况下,您应该将其更改为
List<System.Web.Mail.MailAttachment>
希望对有所帮助