Automatic email documents generated out of Epicor

Pretty nice @Chris_Conn ,
For what its worth if you are in a BPM you can use the built in Epicor Mailer class to send SMTP email with attachments. This makes it a little simpler since it will use the configured Epicor SMTP settings that you’ve already established when you setup Epicor.

     var mailer = this.GetMailer(async: true);
     var message = new Ice.Mail.SmtpMail();
     message.SetFrom("email@email.com");
     message.SetTo("email1@email.com;email2@email.com");
     //message.SetCC()
     //message.SetBcc() 
     message.SetBody("<html><body><p>MyMessage Here</p></body></html>");
     Dictionary<string, string> attachments = new Dictionary<string, string>();
     attachments.Add("MyFirstAttachment", @"\\MyServer\myFolder\MyFile.pdf");
     mailer.Send(message, attachments);
9 Likes