-
-
Notifications
You must be signed in to change notification settings - Fork 11
POP3 Examples
Andrew Lambert edited this page Jan 14, 2023
·
7 revisions
These examples demonstrate libcurl's basic support for listing, retrieving, and deleting emails on a POP3 server.
Dim c As New cURLClient
c.Username = "Bob"
c.Password = "seekrit"
If c.Get("pop3://pop.example.com/1") Then
Dim email As String = c.GetDownloadedData
MsgBox("Email retrieved successfully.")
Else
MsgBox("Error: " + Str(c.LastError))
End If
Dim c As New cURLClient
c.Username = "Bob"
c.Password = "seekrit"
c.SetRequestMethod("TOP 1 0")
If c.Get("pop3://pop.example.com") Then
Dim emailheader As String = c.GetDownloadedData
MsgBox("Email headers retrieved successfully.")
Else
MsgBox("Error: " + Str(c.LastError))
End If
Dim c As New cURLClient
c.Username = "Bob"
c.Password = "seekrit"
If c.Get("pop3://pop.example.com/") Then
MsgBox("Mailbox enumerated successfully.")
Else
MsgBox("Error: " + Str(c.LastError))
End If
Dim c As New cURLClient
c.Username = "Bob"
c.Password = "seekrit"
c.SetRequestMethod("DELE")
If c.Head("pop3://pop.example.com/1") Then
MsgBox("Message deleted successfully.")
Else
MsgBox("Error: " + Str(c.LastError))
End If
Dim c As New cURLClient
c.Username = "Bob"
c.Password = "seekrit"
c.SetRequestMethod("NOOP")
If c.Head("pop3://pop.example.com/1") Then
MsgBox("POP3 no-operation sent successfully.")
Else
MsgBox("Error: " + Str(c.LastError))
End If
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.