Hi,
here is a code example which attached a file to the e-mail.
protected void Button2_Click1(object sender, EventArgs e)
{
EmailMessage msg = new CMS.EmailEngine.EmailMessage();
EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("template.codename", CMSContext.CurrentSiteID);
MacroResolver mcr = new MacroResolver();
msg.EmailFormat = EmailFormatEnum.Both;
msg.From = eti.TemplateFrom;
msg.Recipients = "to@somebody.com";
msg.Subject = eti.TemplateSubject;
System.Net.Mail.Attachment item = new System.Net.Mail.Attachment("filePath");
msg.Attachments.Add(item);
EmailSender.SendEmailWithTemplateText(CMSContext.CurrentSiteName, msg, eti, mcr, true );
}
Best regards,
Ivana Tomanickova