Skip to main content

psmail

The psmail program sends email in any language from a Win32 console to an SMTP server. It is used by the Notification Service (psntfsvc) to send emails generated by the notification system.

Usage
 psmail.exe  -server <server name> [-port <port>] [-plugin <plugin>] [-to <address> ] [-cc <address> ] [-bcc <address> ] [-from <address>] [-useauth <authtype> [-authname <smtp login ID> -authpass <smtp auth password>]][-subject <subject> -content <message text> -attachment <file> <type> ] [-contenttype <content type>] [-charset <set type>]

Argument

Description

-server <mail server>

The SMTP mail server name.

-port <port>

Specify the mail server port.

If you do not specify a port, psmail defaults to port 25.

-plugin <plugin>

Specify the plugin to be used.

If you do not specify a plugin, global-mail-plugin.py is used by default.

-to <address>

Specify the recipient’s address.

-cc <address>

Specify the CC recipient’s address.

-bcc <address>

Specify the BCC recipient’s address.

-from <address>

The sender’s email address.

-subject <subject>

Text to use for the subject line of the message.

The text must be enclosed in quotes if it includes spaces.

-content <message text>

Text to use for the body of the message.

The text must be enclosed in quotes if it includes spaces.

-useauth <authtype>

Authentication type to use.

This is currently NONE or LOGIN. If the type is:

  • LOGIN, credentials must be supplied using the -authname and -authpass parameters, or they will be read from MAIL AUTH LOGIN and MAIL AUTH PASSWORD on the Email configuration page.

  • NONE, you must NOT specify -authname and -authpass. MAIL AUTH LOGIN and MAIL AUTH PASSWORD must also be empty on the Email configuration page. Use the NONE type when your SMTP mail server does not use authentication.

-authname <name>

Username for authentication.

-authpass <password>

Password for authentication.

-attachment <file> [<type>]

A file to attach and an optional content type.

The psmail program guesses the content type if you do not specify it. Common types include:

  • application/octet-stream

  • application/zip

  • text/plain

  • text/html

-contentType <content type>

The email content type. This value can either be 0 for plaintext or 1 for HTML. If you do not specify a content type, 0 will be used by default.

-charset <set type>

Character set to use. Default is utf-8 if unspecified.

Examples

To send an email to an address using smtp authentication and providing subject and message, type on one line:

-psmail.exe -server myserver -port 25 -to johnd@example.com -from bravura@example.com -subject "This is a subject" -content "This is the message" -useauth LOGIN -authname psadmin -authpass Password