ServerAddress | Address of email server to check for email. |
Username | Account username (quite possibly same as the email address |
Password | Password for the account. |
DeleteMode | Optional. Set this to "DeleteAll" to make it delete all the emails that it receives from the server. Defaults to "DeleteNone". |
If you want to know how many email messages you have in the dict, you can use [dict size $MyEmailDict]
.
Note that POP3 does not have support for read / unread messages. Your alternatives are to download each time and use something within the messages to see that they are new -OR- delete all messages every time you download. There is no known way that you would lose your messages from the command itself due to error because it will always wait until it has completely downloaded and parsed all messages before sending the delete command.
Note that this command will not try to process or recover from any errors thrown from the pop3
or mime
packages. If you do get an error, double check that you are using the correct values for your arguments.
% 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 [GetEmailUsingPop3 email-server.com receiver@email-server.com ThePassword]
% 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