Adding File Attachments to Outgoing email
Joined: 24 Jan 2010
Topic: Adding File Attachments to Outgoing email
Posted: 06 Jul 2012 at 5:06pm
I am having trouble sending out emails with file attachments when I want to variably control how many files to attach.
I may have from 1 to 4 attachments to send out and it varies based on the input data. I am using the built in field %msg_attachments% in the "send an email" trigger action in the attach section of the email.
In the script I tried populating the "msg_attachments" built in field like so
msg_attachments = FIELDS_Value("file_attachment") & vbCrLf & FIELDS_Value("sfile_attachment")
that doesn't work, I get "could not add attachment" error.
I tried using a comma between file names, I tried a semicolon as well, neither work.
The field names also contain the entire path to the file as well as the file name.
what am I doing wrong?
Joined: 21 Oct 2005
Location: Stoke on Trent
|Post Options Quote Reply Posted: 10 Jul 2012 at 10:58am|
The msg_attachments field just contains the attachment names separated by commas - not their actual location.
You will need to use a script to populate an Email2DB Field with the attachments you want to send out using the MSG_AttachmentTempLocation array which contains a list of the attachment actual locations.
Create an Email2DB field called 'SendAttachments'.
Now create a 'Run A Script' action.
Set the script to:
Then on your outgoing email - drag the 'SendAttachments' field onto the Attachments entry.
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum