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/Send Email/IMAP Upload
This example is the version from Wed, 3rd Jan 2023.
Project "IMAP Upload.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu2 = ""
End MenuBar
Class App Inherits Application
End Class
Class MainWindow Inherits Window
Control LogField Inherits TextArea
ControlInstance LogField Inherits TextArea
End Control
EventHandler Sub Open()
// we use here TLS with this login:
Const Server = "sslin.df.eu"
Const Username = "test@macsw.de"
Const Password = "xxx"
// we build a test email to upload
Dim email As New CURLEmailMBS
email.Subject = "Test Email"
email.PlainText = "We uploaded this email via MBS Plugin."+EndOfLine+EndOfLine+"Greetings"+EndOfLine
email.AddTo "test@test.test", "John Miller"
email.SetFrom "test@test.test", "Marc Jones"
Dim curl As New CURLSMBS
curl.OptionURL = "imap://"+Server+"/INBOX.Sent"
curl.OptionUsername = Username
curl.OptionPassword = Password
curl.OptionUseSSL = curl.kUseSSLall
// payload for upload is the email source code
curl.InputData = email.EmailSource
curl.OptionUpload = True
Dim e As Integer = curl.Perform
If e<>0 Then
MessageBox "Failed with error code: "+Str(e) + ": "+curl.LasterrorMessage
Else
MessageBox "Email uploaded!"
End If
// show log
Dim s As String = curl.DebugMessages
If s.Encoding = Nil Then
s = DefineEncoding(s, encodings.ISOLatin1)
End If
s = ReplaceLineEndings(s, EndOfLine)
LogField.Text = s
// when succesful it should end with "We are completely uploaded and fine" from CURL and then "Append completed" from server.
End EventHandler
End Class
End Project
See also:
- /CURL/Send Email/MassEmailer
- /CURL/Send Email/older examples/CURLS send email
- /CURL/Send Email/older examples/CURLS send email with images
- /CURL/Send Email/older examples/CURLS send email with SSL
- /CURL/Send Email/Send email
- /CURL/Send Email/Send Email in Background async
- /CURL/Send Email/Send email in web
The items on this page are in the following plugins: MBS CURL Plugin.