Python "it" Scripting
Email Image

return to main index

View Code:


This page presents a python script for an 'it' command that will send an email message with the current catalog image as an attachment. The interface is split into two tabbed panels - figures 1 and 2. In the "Sign In" panel the user must enter the name of their email account's Simple Mail Transfer Protocol (SMTP) server, it's port number, their email address and password. This link lists the names of many SMTP servers.

Please note the script will not run on Linux when using RMS18 because a python module named "mime" was mistakenly not included by Pixar in the RMS18 distribution. To correct this issue the download of contains a "mime.tar" file. It can be used to install the missing module as follows.

    cd $RMSTREE
    tar xvf ~/Downloads/mime.tar

Figure 1

Figure 2

The "Email" field is where the user must enter their email address. The values of most of the text fields can be permanently set via the following defaults. For example,

class EmailImage(It3Command):
    DEFAULT_PORT = '587'

Naturally, there is not a default "Password" variable so it must be entered via the UI when the "Email Image..." menu is used.

Figure 3

© 2002- Malcolm Kesson. All rights reserved.