NAME
GetEmailUsingImap4 — Log onto server with IMAP4, get messages, close connection.
SYNOPSIS
GetEmailUsingImap4 EmailAddress Password ?DeleteMode?
DESCRIPTION
Return Value
Dict containing email messages.
Arguments
EmailAddressEmail address to get messages for.
PasswordPassword to login to the account associated with the email address.
DeleteModeOptional. Set this to "DeleteAll" to make it delete all the emails that it receives from the server. Defaults to "DeleteNone".
More Info
For complete information on how to configure Gen to use email, see About Email Use.

This command will return to you a dict. At the top level, there will be a key per message number (starting from 1). Subsequent keys are: From, To, Subject, Date, and Body. See Examples for details.

If you want to know how many email messages you have in the dict, you can use [dict size $MyEmailDict].

Currently, you must elect to always download all messages and leave them on the server or delete them all.

Currently, SSL/TLS use has not been tested.

Note that this command will not try to process or recover from any errors thrown from the imap4 package. If you do get an error, double check that you are using the correct values for your arguments and the config variables. In particular, pay attention to which port number you use and your account name. If you do get an error, double check that you are using the correct values for your arguments.


For information regarding exceptions / errors, see here.
EXAMPLES
% SendEmail receiver@email-server.com test1 {test 1-2-3}
% SendEmail receiver@email-server.com test2 {test 4-5-6}
% SendEmail receiver@email-server.com test3 {test 7-8-9}
% set MyEmail [GetEmailUsingImap4 receiver@email-server.com Password]
% dict for {Key Message} $MyEmail { dict for {Key Value} $Message {puts "$Key: $Value"} }
From: sender@email-server.com
To: receiver@email-server.com
Subject: test1
Date: Sat Jan 01 00:00:00 EST 2000
Body: test 1-2-3

From: sender@email-server.com
To: receiver@email-server.com
Subject: test2
Date: Sat Jan 01 00:00:10 EST 2000
Body: test 4-5-6

From: sender@email-server.com
To: receiver@email-server.com
Subject: test3
Date: Sat Jan 01 00:00:20 EST 2000
Body: test 7-8-9
SEE ALSO
GetEmailUsingPop3, SendEmail
KEYWORDS
email, network