0

这对你们大师来说可能很简单,但我很难过。我有一种方法可以收集电子邮件的所有信息,然后通过 Outlook 发送出去。但是,我想考虑多个附件。我该怎么做?我需要在方法头中更改什么?

public static void sendOutlookMail(string toAddress, string emailSubject, string ccAddress = null, string emailAttachment = null, string emailBody = null)

我知道我必须更改,但不确定要更改什么并保留默认值:

string emailAttachment = null

提前致谢。

如果您需要更多详细信息,请告诉我。

4

2 回答 2

1

如果你想传递字符串列表,你可以替换它:

     string emailAttachment = null

有了这个:

    List<string> emailAttachment = null
于 2012-02-08T16:12:39.597 回答
1

理想情况下,您应该将其更改为

List<System.Web.Mail.MailAttachment>

希望有帮助

于 2012-02-08T16:12:45.317 回答