About pyMailer

pyMailer is a cute little app which strives to do just one thing well. That one thing is sending mails. pyMailer is written in python which automatically provides for platform independence.

Installation

pyMailer comes in 2 packages:
- python scripts and
- win32 executables created by py2exe.

To run scripts version, you need python 2.2 or higher version. Installation is pretty simple: just download the zipped files and extract to some directory. You can run 'installsendto' to add a link to pymailer in SendTo on windows. This comes pretty handy for sending files quickly.

Usage

Command Line Version:

It's mostly meant for unix. (who uses commands on windows anyways ;-)).
Usage: pymailer.py [options] to [to ...]*

Options:
    -h, --help  Print this message and exit.

    -a          Attachment. Use multiple '-a' options to attach multiple files
    -s,--subject
                Subject
    -f,--from   Fromaddr
    --smtpstr   Smtp string in the format 'server:port|encrypt|user|password'
    --smtpsvr   Smtp server in the format server:port.
                All other fields are considered empty in smtpstr

`to' is the email address of the recipient of the message, and multiple
recipients may be given.
Examples:

To send using local smtp server -
python pymailer.py -s "system configuration file" -a /etc/sysctl.conf \
 -f root manugarg@gmail.com </dev/null


To send using your company's smtp server -
python pymailer.py -s "System logs" -a /var/log/messeges -f root --smtpsvr\
"smtp.yourcompany.com:25" manugarg@gmail.com </dev/null

To send using gmail's smtp server -
python pymailer.py -s "other mail" -a $HOME/notes -f manugarg@gmail.com --smtpstr \ "smtp.gmail.com:587|TLS|manugarg@gmail.com|mypassword" manu.garg@work.com </dev/null

Graphical Interface

This version has rather more features and as a matter of fact I started writing this first and command line version was a side product of development of this version.

$python pymailerw.py [file1] [file2] ...   or, if you are using executables on windows
pymailerw.exe [file1] [file2] ...

First run:

First run with no saved configuration

This shows the screenshot of the first run, with no saved configuration. You can specify recepeints in by checking the ‘Others’ box or you can configure 'Contacts' list for quick selection.  To be able to send mail you need to configure some SMTP options first.

Editing Send Options:

This version reads sending options from a configuration file which is stored in your profile directory. You can edit this file directly from the main window by clicking 'Edit Send Options' button. This opens up a new window in which you can add/edit smtp options. You specify smtp options using the same smtp string format. We'll talk more about smtp string in coming section.

Editing send options

Once you are finished with editing, save the file and exit. To effect the changes, you will have to click on 'Reload' button on main screen.

Editing Contacts:

This is not a requirement, but it comes handy when you send mails to same email addresses frequently. This configuration is also stored in a file. To edit this file click on 'Edit Contacts'. It will pop up a window where you can edit these options.


Editing Contacts

First 5 contacts from this file, appear on main window. Rest you can select by clicking on 'Find' button next to 'Others' textbox.

All of these configurations are saved in you profile directory. Next time when you open pymailerw, these configurations are automatically read and resulting window looks something like below:

With saved configuration

If you specify a filename at command line, that will appear inside ‘File’ textbox and file name is automatically added to the ‘Subject’ field. This is what happens when you send a file using 'SendTo' list in Windows.

SMTP String

SMTP string is ubiquitous in pyMailer. It’s a convenient way to specify smtp options.

'server:port|encrypt|user|password'

server:port SMTP server and port. If this field is left empty, it is assumed to be local server.
encrypt Specifies if SMTP server uses encryption. If this field is empty, no encryption is used. Currently only ‘TLS’ encryption is supported.
user It specifies username if server requires authentication. If this field is empty, no authentication is used.
password Password if authentication is required. If this field is empty and ‘user’ is non-empty, user is prompted for the password before sending mail.

Questions/Suggestions/Bugs

I can be reached at manugarg at gmail dot com. I'll be pleased to help you with anything related to pymailer.