SmartsIntegrator Support and Discussion Forums

Emailing from a Workflow

Share/Bookmark: Add this Thread to Digg Digg   Add this Thread to StumbleUpon Stumble Upon   Add this Thread to Del.icio.us Del.icio.us   Add this Thread to Reddit Reddit   Add this Thread to Facebook Facebook
RE: Emailing from a Workflow
by benj on Fri, Jan 16 2009 1:07 PM
Hi Mike

If done this way, you send the Message to a Port, and the Attachment name is configured on the Port (Email Send transport page). You can only send one attachment.

The other way to do it is to use the .Net Email support directly, as in the following example :

System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(smtpAddress);
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage(from, to, subject, body);
mm.Attachments.Add (new System.Net.Mail.Attachment (contents1, name1));
mm.Attachments.Add (new System.Net.Mail.Attachment (contents2, name2));
mm.Attachments.Add (new System.Net.Mail.Attachment (contents3, name3));
client.Send(mm);

Thanks,

Ben.
Ben Jackson
SmartsIntegrator Technical Support
benj
benj
Joined: Thu, Feb 7 2008
Posts: 96
Emailing from a Workflow
by portedquery on Fri, Jan 16 2009 1:05 PM
Hi Ben,

We exchanged an e-mail a while back regarding sending out attachments via e-mail.

this.outgoingEmail = new Message();
this.outgoingEmail.MessageBody = “Hello”; // or for binary data use the MessageStream property

My questions are,

1) How can you set the name of this attachment?
2) How can you send more than one attachment per message with the approriate name?
portedquery
Joined: Wed, Jul 2 2008
Posts: 72