Jump to content

Emailing Attachments

Recommended Posts

I'm trying to create a very simple script in Automate to email us a log file each day, however my script is failing with "The reason: Invalid attachment - aborting email". 

I have the file path typed directly into the "File Path" section of the "Email" function in the form "C:\path\to\file.txt".  I've verified that the path is correct (it's copied directly out of Explorer) and that the file does in fact exist. I've tried the path with and without parenthesis, and tried loading the attachment in a separate step, using the "Email Load Attachment" function, but get the same error.

Has anyone seen an issue like this, or am I missing something obvious?

Share this post

Link to post
Share on other sites

The attachment path is relative to the LTServer. If you have a file on the agent you need to use the "File Upload" function to transfer it to the server, which will create a variable named %uploadedfile%. Then in the Email Attachment path, just put %uploadedfile%.

If you have more than 1 file to attach, you will need to use the "Email Load Attachment" function after each "File Upload" step (again with %uploadedfile%, and it will return an attachment ID to a variable you specify. Assume you use the name "attid".  You could add that to a variable list (Set @myattachments@=@myattachments@@attid@," after each "Email Load Attachment" call and then use @myattachments@) for the email attachment field. Or, use a unique variable name each time you load an attachment like attid1, attid2, attid3, and then put @attid1@,@attid2@,@attid3@ in the email attachment field when sending.

Documentation References:


  • Like 3

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...