Emailing Images

Top  Previous  Next

 

When the output option is set to "Print and JPEG copy" or "JPEG copy only" an optional command can be run on the JPEG copy of the layout:
 

upload_cmd_settings

 

 

This command normally sends an email using the email_image.exe utility included with Hotfolder Prints. Click on the "Edit email settings..." button to display the email settings dialog:

 

flickr_email_settings

 

To send an email you need to specify at least the originator's email address (the "From:" field), the recipient's email address (the "To:" field") and the host name of your email server. Most email servers also require a username and a password to prevent unauthorized users from sending spam emails. For additional security select the "Use SSL for secure email" option to send the email using SSL. The port number should normally be set to 587 when using SSL secure email or 25 otherwise (please check the port numbers used by your ISP). Google's free GMail service is a convenient way to send emails and can be set up using the settings shown above and replacing myname@gmail.com with your GMail email address and entering your password.

 

The subject and message fields can include any of the standard tokens (e.g. %d for the date). The special token {pathname} is be used as a placeholder for the path of the JPEG layout image to be uploaded and is automatically added to the command line by the email settings dialog.

 

In normal operation no window will be displayed when an email is set. Select the "Display debug window when sending email" if you want to display a window showing information about the sending of the email for debug purposes. If the sending of the email fails for any reason a window containing an error message is displayed for a few seconds. If the internet connection is unreliable the "Retries" setting can be used to set the number of times it attempts to send the email.

 

Once the email server settings have been entered a test email can be sent by pressing the "Send test email" button. This will call email_images.exe in debug mode and send a short test email and image to test the connection and settings.

 

The screenshot above shows typical settings for uploading images to Flickr using Google's gmail mail servers.

 
The email_image.exe command line email utility has the following options:

-o<originator>  the originator's email address

-r<recipient>   the recipient's email address (where the email is sent to)

-s<subject>     optional subject line

-b<body>        optional message body

 

Hotfolder Prints will read user data stored in the XML saved by our photobooth software and make this available in the {user_data} token. This allows users to enter their email address using the touchscreen keyboard option in the photobooth and for Hotfolder Prints to format the images for emailing and then send them to the user's email address:

email_settings

Users' email addresses can be saved to a CSV log file for future reference by selecting "Log email addresses to file" and specifying the name and location of the log file. The information is stored in the following format:

<date>,<time>,<email>,<image>,<status>

Where <date> is the date in the form YYYYMMDD, <time> is the time in the form hhmmss, <email> is the user's email address and <status> is "sent" if the email was sent successfully or "fail" if there was an error.
 

 

Logging email failures and sending emails after an event

 

If the internet connection at an event is unreliable or not available Hotfolder Prints may not be able to send the emails during the event but can save a batch file which can be run later when a reliable internet connection is available to send the emails. To enable the writing of the failed emails batch file select the "Log email addresses to file" option and specify the name of the log file. In additional to writing the log file, the commands to send any failed emails will be written to a separate log file which has the same name as the main log file but with _failed.log appended e.g. in the screenshot above the main log file is C:\Users\Chris\Documents\email_log.csv and the failed emails log file would be named C:\Users\Chris\Documents\email_log_failed.log. To send the failed emails simply rename the log file to give it a .bat file extension, e.g. C:\Users\Chris\Documents\email_log_failed.bat, and then run the batch file by double clicking on it in Windows Explorer.