Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Setups existing CURL session for an email transfer.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SendMail | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
EmailID | The email reference number obtained using SendMail.CreateEmail function. | $EmailID |
CURLID | The CURL session handle. | $curl |
Returns OK or error.
Setup and send email with all options:
Set Variable [$EmailID; Value:MBS("SendMail.CreateEmail")]
Set Variable [$r; Value:MBS("SendMail.SetFrom"; $EmailID; EMail::FromEmail; EMail::FromName)]
Set Variable [$r; Value:MBS("SendMail.SetHTMLText"; $EmailID; EMail::HTMLText)]
Set Variable [$r; Value:MBS("SendMail.SetPlainText"; $EmailID; EMail::PlainText)]
Set Variable [$r; Value:MBS("SendMail.SetSubject"; $EmailID; EMail::Subject)]
Set Variable [$r; Value:MBS("SendMail.SetSMTPServer"; $EmailID; EMail::SMTP Server; EMail::SMTP SSL)]
Set Variable [$r; Value:MBS("SendMail.SetSMTPUserName"; $EmailID; EMail::SMTP Username)]
Set Variable [$r; Value:MBS("SendMail.SetSMTPPassword"; $EmailID; EMail::SMTP Password)]
Set Variable [$r; Value:MBS("SendMail.AddTo"; $EmailID; Recipient::Email; Recipient::Name)]
Set Variable [$r; Value:MBS("SendMail.AddCC"; $EmailID; Recipient::Email; Recipient::Name)]
Set Variable [$r; Value:MBS("SendMail.AddBCC"; $EmailID; Recipient::Email; Recipient::Name)]
Set Variable [$r; Value:MBS("SendMail.AddAttachmentContainer"; $EmailID; Attachment::Container; Attachment::Name; Attachment::Type)]
Set Variable [$r; Value:MBS("SendMail.AddAttachmentFile"; $EmailID; Attachment::Path; Attachment::Name; Attachment::Type)]
Set Field [EMail::EmailSource; MBS( "Text.ReplaceNewline"; MBS("SendMail.GetSource"; $EmailID); 1)]
Set Variable [$curl; Value:MBS("CURL.New")]
Set Variable [$r; Value:MBS("SendMail.PrepareCURL"; $EmailID; $curl)]
Set Variable [$r; Value:MBS("CURL.Perform"; $curl)]
Set Field [EMail::DebugInput; MBS("Text.ReplaceNewline"; MBS("CURL.GetHeaderAsText"; $curl);1)]
Set Field [EMail::DebugMessages; MBS("Text.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1)]
Set Variable [$r; Value:MBS("CURL.Release"; $curl)]
Set Variable [$r; Value:MBS("SendMail.Release"; $EmailID)]
Setup to use MobileMe server for sending:
Set Variable [ $EmailID ; Value: MBS("SendMail.CreateEmail") ]
# ... later ...
Set Variable [ $r ; Value: MBS("SendMail.SetSMTPServer"; $EmailID; "smtp.mail.me.com") ]
Set Variable [ $r ; Value: MBS("SendMail.SetSMTPUserName"; $EmailID; "someone@me.com") ]
Set Variable [ $r ; Value: MBS("SendMail.SetSMTPPassword"; $EmailID; "xxxxxx") ]
# ... later ...
Set Variable [ $r ; Value: MBS("SendMail.PrepareCURL"; $EmailID; $curl) ]
# ... later ...
Set Variable [ $r ; Value: MBS("CURL.SetOptionPort"; $curl; 587) // custom port ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) // full SSL ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLS v1.2 ]
Created 3th September 2014, last changed 27th August 2021
SendMail.GetSubject - SendMail.Release
Feedback: Report problem or ask question.