GETMAIL        Get an e-mail message

Top  Previous  Next

Syntax:

GETMAIL

[ server ] [ subj ] [ mail file ] [ /options ]

Arguments:

[ server ]

Variable or string defining the server URL or IP address (e.g., pop3.mail.server or 209.198.128.17) of the POP mail server; the server port is always set to 110.

 

[ subj ]

Variable or string for the message subject line; [ subj ] must be a variable initialized to an empty string to get the first available message (the subject line of the message is returned by way of this variable); or [ subj ] must be a variable or string initialized to an non-empty value specifying the subject line of a specific message to look for on the server (searches are all inclusive and case-sensitive).

 

[ mail file ]

Variable or string defining the optional file name to which the received message is written; if [ mail file ] is an empty string then the message is discarded.

Options:

/nodelete

Do not delete the message from the server (leave on server).

 

/pw=xx

Define the password to use when logging on to the incoming mail server.

 

/timeout=nn

Time-out, in seconds, to wait for message to be received (if omitted the time-out is set to 30 seconds).

 

/user=xx

Define the user name to use when logging on to the mail server.

 

/view

View the message in a pop-up window.

 

 

This command either gets the first e-mail message available on the specified POP server or searches all messages for one with a matching subject line. Received messages may optionally be viewed and/or saved to a file for processing by another e-mail client or application. The file contains the full e-mail message, including headers, in .eml format.

 

When the [ subj ] variable is set to an empty string when calling GETMAIL, Robo-FTP gets the next available message on the server. When using GETMAIL in this way, it is recommended to use a dedicated mailbox to prevent Robo-FTP from possibly obtaining non-relevant messages. Upon return, the [ subj ] variable will contain the subject line of the message downloaded. Use of the /nodelete option is not advised since GETMAIL will return the same message over and over again unless it is deleted from the server by another user or process.

 

When searching for a specific message, the [ subj ] variable must be initialized to the desired subject line prior to calling GETMAIL. Messages not matching the subject line comparison are left undisturbed on the server. If you only wish to check for the presense of a specific message (and leave it on the server too), use the /nodelete option.

 

Consider the following example in which the first available e-mail message is received but not saved to a file, and the message is deleted from the server after it is received.

 

SET server = "pop3.mail.server"

SET subj = ""

;; subj argument MUST be a variable since subject line

;; found in the message is returned

GETMAIL server subj "" /user=pop3id /pw=pop3pw

 

In the following example, the first available e-mail message is obtained and written to a uniquely named file.

 

SET server = "pop3.mail.server"

SET subj = ""

MAKEFILENAME file "eml" "c:\email messages" "mail"

GETMAIL server subj file /user=pop3id /pw=pop3pw

 

In the following example, e-mail messages on the server are searched for a specific subject. If found, the message is downloaded, saved to a file, but is left on the server.

 

SET server = "pop3.mail.server"

MAKEFILENAME file "eml" "c:\email messages" "mail"

;; when subj (variable or string)is not empty, search for this

;; subject line in available messages (nothing is returned)

GETMAIL server "this one" file /user=pop3id /pw=pop3pw /nodelete

 

In the preceding example, the same message would be returned if GETMAIL was executed again since /nodelete was specified.

 

Related Command(s): CREATEMAIL, MAILTO, SENDMAIL