Closed
Solved
SMTP Attachments
Hi I was wondering if anyone has used SMTP to send emails in an automation. my automation needs to have an attachment sometimes, however seems to hold on to them for emails after attachment is attached??
***Edited by Moderator Marissa to update categories***
In order to release attachments we have created a script that did the trick.
public void ResetSmtpAttachments(OpenSpan.Controls.Smtp smtp)
{
System.Reflection.FieldInfo field = smtp.GetType().GetField("mMailMessage", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
System.Net.Mail.MailMessage mailMsg = (System.Net.Mail.MailMessage)field.GetValue(smtp);
mailMsg.Attachments.Clear();
}