inquisitive_one
inquisitive_one

Reputation: 1495

Send Email multiple attachments from LINQ list

This might be very simple for you Gurus but I'm stumped on this. I have a method that will gather all the info for an email and then send it out via outlook. However, I want to account for multiple attachments. How would I do that? What do I need to change in my method header?

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

I know that I have to change, but not sure to what and keep a default value:

string emailAttachment = null

Thanks in advance.

Please let me know if you need more details.

Upvotes: 0

Views: 385

Answers (2)

Sebastian Siek
Sebastian Siek

Reputation: 2075

ideally you should change that to

List<System.Web.Mail.MailAttachment>

Hope that helps

Upvotes: 1

David
David

Reputation: 432

If you want to pass list of string you can replace this:

     string emailAttachment = null

with this:

    List<string> emailAttachment = null

Upvotes: 1

Related Questions