本文整理汇总了C#中System.Web.Mail.MailAttachment.MailAttachment构造函数的典型用法代码示例。如果您正苦于以下问题:C# MailAttachment构造函数的具体用法?C# MailAttachment怎么用?C# MailAttachment使用的例子?那么, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了MailAttachment构造函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MailMessage
//This example shows how to programmatically add attached files
//to a mail lessage.
MailMessage myMail = new MailMessage();
// Concatenate a list of attachment files in a string.
string sAttach = @"C:\images\image1.jpg,C:\images\image2.jpg,C:\images\image3.jpg";
// Build an IList of mail attachments using the files named in the string.
char[] delim = new char[] {','};
foreach (string sSubstr in sAttach.Split(delim))
{
MailAttachment myAttachment = new MailAttachment(sSubstr);
myMail.Attachments.Add(myAttachment);
}