GETMAIL Get an e-mail message |
Top Previous Next |
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 and any attachments, in .eml format. Attachments may be MIME encoded.
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
|