(Lianja) POP3 STARTTLS
Demonstrates how to do POP3 STARTTLS.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
// The mailman object is used for receiving (POP3)
// and sending (SMTP) email.
loMailman = createobject("CkMailMan")
// Set the POP3 server's hostname
loMailman.MailHost = "pop.gmail.com"
// Set the POP3 login/password.
loMailman.PopUsername = "****@gmail.com"
loMailman.PopPassword = "****"
// Indicate that we want TLS/SSL. Also, set the port to 995:
loMailman.MailPort = 995
loMailman.PopSsl = .T.
loBundle = loMailman.CopyMail()
if (loMailman.LastMethodSuccess = .F.) then
? loMailman.LastErrorText
release loMailman
return
endif
i = 0
do while i < loBundle.MessageCount
loEmail = loBundle.GetEmail(i)
// Display the From email address and the subject.
? "From: " + loEmail.From
? "Subject: " + loEmail.Subject
release loEmail
i = i + 1
enddo
release loBundle
release loMailman
|