Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS CURL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/CURLS pop3 email delete
This example is the version from Wed, 3rd Jan 2023.
Project "CURLS pop3 email delete.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
run
End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Server Inherits TextField
ControlInstance Server Inherits TextField
End Control
Control Username Inherits TextField
ControlInstance Username Inherits TextField
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control Passwort Inherits TextField
ControlInstance Passwort Inherits TextField
End Control
Control ResultText Inherits Label
ControlInstance ResultText Inherits Label
End Control
Control EmailIndex Inherits TextField
ControlInstance EmailIndex Inherits TextField
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control content Inherits TextArea
ControlInstance content Inherits TextArea
End Control
Sub Run()
content.text = ""
dim curl as new myCURLSMBS
// the right combination of server, procotol (POP3S or POP3), the port (25, 995 or other), the TLS upgrade can be a challenge!
curl.CollectDebugMessages = true
curl.CollectHeaders = true
curl.CollectOutputData = true
curl.OptionDirListOnly = true // don't download something, just run our request
curl.OptionURL = "pop3://"+Server.Text+"/"+EmailIndex.Text
'curl.OptionPort = 995
curl.OptionUsername = Username.Text
curl.OptionPassword = Passwort.Text
curl.OptionCustomRequest = "DELE"
curl.YieldTime = true
curl.OptionVerbose = true
curl.OptionSSLVerifyHost = 0
curl.OptionSSLVerifypeer = 0
curl.OptionUseSSL = curl.kFTPSSL_TRY // try SSL
curl.OptionConnectionTimeout = 10 // 10 seconds
curl.OptionTimeOut = 20 // 20 seconds
dim ErrorCode as integer = curl.Perform
ResultText.text="Result: "+str(ErrorCode)
if ErrorCode = 56 then
ResultText.text = ResultText.text + " no email"
end if
dim d as string = curl.DebugMessages
if encodings.UTF8.IsValidData(d) then
d = DefineEncoding(d, encodings.UTF8)
else
d = DefineEncoding(d, encodings.ISOLatin1)
end if
content.Text = ReplaceLineEndings(d, EndOfLine)
End Sub
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu5 = ""
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu4 = ""
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = ""
End MenuBar
Class App Inherits Application
End Class
Class MyCURLSMBS Inherits CURLSMBS
EventHandler Sub DebugMessage(infotype as integer, data as string, dataSize as Integer)
System.DebugLog data
End EventHandler
End Class
End Project
See also:
- /CURL/CURLS Amazon S3 download
- /CURL/CURLS Amazon S3 pre-signed URL
- /CURL/CURLS connect try
- /CURL/CURLS get and put/CURLS get and put
- /CURL/CURLS info
- /CURL/CURLS post form values/CURLS post form values
- /CURL/CURLS preemptive threaded upload
- /CURL/CURLS resume download with speed measurement
- /CURL/CURLS simple file download
- /CURL/CURLS upload to Web App/Web Upload Receiver
The items on this page are in the following plugins: MBS CURL Plugin.