Check out the sample code below to
see just how easy it is to use the IMAP4 component
of
EasyMail Objects. But don't let the ease of use
fool you; the IMAP4
component
is very powerful and
packed with features. The sample code on this page demonstrates the most basic features of
the IMAP4 component. Be sure to click on the "Other Samples" tab to find
more advanced samples.
| Sample Notes | | This sample demonstrates the basic functionality of the IMAP4 component that connects to a mail box and displays how many messages are available. |
Set IMAP4 = CreateObject("EasyMail.IMAP4") x = IMAP4.Connect("mail.domain.com") x = IMAP4.Login("jdoe", "secret") x = IMAP4.SelectMailbox("Inbox") if x = 0 then MsgBox "You have " & IMAP4.MessageCount & " messages waiting." else MsgBox "There was an error retrieving your mail. Error code: " & x end if IMAP4.Logout IMAP4.Disconnect
|