Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Setups existing CURL session for an email transfer.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
SendMail 4.3 Yes Yes Yes Yes Yes
MBS( "SendMail.PrepareCURL"; EmailID; CURLID )   More


Parameter Description Example value
EmailID The email reference number obtained using SendMail.CreateEmail function. $EmailID
CURLID The CURL session handle. $curl


Returns OK or error.


Setups existing CURL session for an email transfer.
You can set your own settings like proxy after this function call.
If you like you can reuse the email and curl objects after you sent an email, change values and send another email.


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.Cleanup"; $curl)]
Set Variable [$r; Value:MBS("SendMail.Release"; $EmailID)]

See also

Example Databases

Blog Entries

Created 3th September 2014, last changed 18th October 2014

SendMail.GetSubject   -   SendMail.Release

Feedback: Report problem or ask question.

MBS FileMaker blog