Send email with jpg files attached

One of the strengths of Automation Workshop is a possibility to replace batch files or other scripts with so called manual Tasks. Manual Task is a Task which is started by user (as opposed to automatic execution by a Trigger).

This tutorial will show in step-by-step manner how to create a manual Task to send emails with attachments. Let us suppose we wish to send all .jpg images from C:\My Pictures\ folder to email address recipient@example.com and move these image files to C:\Sent Pictures\ folder.

Batch file replacement…

What steps we need to take to create a Task? Let us see what steps we need to take to create a Task which will send all .jpg images over the email.

  • First, we will need to create a new Task in Task Wizard. Since the Task is intended for manual execution, no Triggers are necessary.
  • Second, we have to add and configure an Action that will send images as email attachments.
  • Finally, we will need to add an Action that will move image files from C:\My Pictures\ to C:\Sent Pictures\ folder.

How to create a Task? First, you will need to create a new Task. Open Automation Workshop manager and choose New Task… from File menu (alternatively, use context menu in Task pane or keyboard shortcut Ctrl+N). The Task Wizard will open. Click Next after reading the Welcome screen. As we are creating a Task for manual execution, skip the Triggers tab by clicking Next. Now we are in the Actions tab.

How to add and configure an Action that will send emails with attachments? Adding Actions is easy. Once in the Actions tab, click the Add button. The list of all available Actions will open in a new Add Actions window. Since we need an Action that sends emails, let us click on the Email category and choose Send Email Action. When selected, click OK (or double-click selected Action) to start configuring the Send email Action.

When configuring Send email Action you will have to provide the same basic data as when using any other email client. Namely, to specify sender's and recipient's email addresses, email subject field as well as email text. The respective fields are From, To and Subject (located in the Email tab of Send Email properties).

How to add an attachment? Now, when you have specified from which address the email will be sent and who will be its recipient as well as subject text, let us see how add an attachment. Click the left mouse button on Attachments input line to put the cursor into it. Additional buttons will be shown, namely, Browse button and Variable Wizard button. Click on Browse button, go to C:\My Pictures\ and choose any .jpg file.

Send email Action - attach all jpg files

How to add all jpg files as an attachments? The Attachment line will show the path and file name (e.g. something like this: C:\My Pictures\Sunset.jpg). If we leave it as it is, each time the email is sent, Send email Action will try to attach exactly this image, namely, Sunset.jpg. However, we need to attach all image files. That is why we need to replace file name (i.e., Sunset.jpg) with file mask *.jpg (all jpg files), so that Attachments field contains C:\My Pictures\*.jpg (instead of initial C:\My Pictures\Sunset.jpg).

If default email server (specified in Server tab of Automation Workshop options) is configured correctly, the configuring of Send Email Action for the Task at hand is finished. Note that it is possible to specify a different SMTP server for each instance of Send Email Action. Click OK to confirm all changes we have made for Send email Action, and we are back to Actions tab of Task Wizard where we can add another Action.

How to add and configure an Action that will move files to another folder? Most likely, when sending email with jpeg images, there is no reason to send the same images to the same email address again and again. To avoid that, we can add an Action that will move all jpeg files from C:\My Pictures\ to C:\Sent Pictures\ folder, after email is sent.

Since we are still in Actions tab of Task Wizard, let us just click Add button again. This time we need to perform file operations, so we open File / Folder category, select Move File Action and click OK to open its properties.

Move file Action - move all jpg files

Move File Action allows moving one or multiple files from one location to another. First, we need to fill Source field (which specifies what files exactly will be moved). Similarly as we did when configuring Send Email Action, in Source field specify C:\My Pictures\*.jpg (meaning, all .jpg files in C:\My Pictures\ folder). Now, let us click on Destination input line and select C:\Sent Pictures\ folder as destination. The Move file Action is configured. Click OK to return to the Task Wizard and complete a few remaining steps (give Task a name, choose reports options, etc.).

The Task is ready! Since it has no Triggers, it will not start automatically. Every time you execute the Task manually, it will attach all .jpg files currently in C:\My Pictures\ folder to email, and send it to specified email address. After finishing with email sending, the Task will continue with the Move file Action, which will move all .jpg images from C:\My Pictures\ to C:\Sent Pictures\ folder, in order to avoid sending of the same images again upon next Task execution.

How can I start the Task? Both automatic and manual Tasks can be executed manually, yet automatic Tasks frequently depend on variable data from their Triggers. In order to diminish accidental launches, Run Task is not the default option when double clicking on Task (instead, it will open Task properties).

To run the Task manually you will have to select the Task in Task pane of Automation Workshop manager, and use one of the following methods:

  • Go to File menu and click Run Task.
  • Click the right mouse button on the Task and choose Run Task option from context menu.
  • Push Ctrl+F5 keyboard shortcut.
  • Click on the Run button on Task toolbar.

Conclusion. We have created a manual Task. Such a Task does not contain any automatic Triggers and, as a consequence, can be executed only manually. When executed, the Task will locate all .jpg image files in C:\My Pictures\ folder and attach them to email. After sending the email with attached images, the Task will move image files to C:\Sent Pictures\ folder.

Note that if new image files are put into C:\My Pictures\ folder in the midst of Task execution, an image may get moved to C:\Sent Pictures\ without ever being sent as email attachment. Let us look at the Task performance step by step to see how it can happen.

  1. At the beginning there is Sunrise.jpg in C:\My Pictures\ folder.
  2. The Task is started.
  3. While the Task is busy with executing Send Email Action, Sunset.jpg image is copied into C:\My Pictures\ folder. Note that files that appear in C:\My Pictures\ folder after Send Email Action has been started are not added as attachments.
  4. The Task executes Move File Action and moves both Sunrise.jpg and Sunset.jpg to C:\Sent Pictures\ folder. As a consequence, Sunset.jpg is in C:\Sent Pictures\ folder although it has never been sent anywhere.

To maintain the proper functioning of this Task, we always need to make sure that no .jpg images are copied into C:\My Pictures\ folder during the Task execution. It might be easy in the case when the folder is only used by local user (as opposed to network share) and the Task is executed manually; however, it is a good idea to create an automatic version of the Task in somewhat different manner.

Free trial 15 day trial · Details…
Buy now 30 day MBG · Details…

If you have any questions, please do not hesitate to contact our support team.

© 2001–2018 Febooti Ltd.