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  

WinSendMail.CreateEmail

Creates a new email.

Component Version macOS Windows Linux Server iOS SDK
WinSendMail 7.1 ❌ No ✅ Yes ❌ No ❌ No ❌ No
MBS( "WinSendMail.CreateEmail" )

Parameters

none

Result

Returns email number or error.

Description

Creates a new email.
The reference number returned by this function can be passed to other plugin functions for setting up the email.
Later use WinSendMail.Release to free memory.
SendMail reference numbers are starting at 67000 and counting up for each new email.

Examples

Send an email with values from field:

Set Variable [ $email; Value:MBS( "WinSendMail.CreateEmail" ) ]
Set Variable [ $r; Value:MBS( "WinSendMail.AddTo"; $email; Send::To Email ; Send::To Name ) ]
Set Variable [ $r; Value:MBS( "WinSendMail.AddCC"; $email; Send::CC Email ; Send::CC Name ) ]
Set Variable [ $r; Value:MBS( "WinSendMail.SetFrom"; $email; Send::From Email ; Send::From Name ) ]
Set Variable [ $r; Value:MBS( "WinSendMail.SetSubject"; $email; Send::Subject ) ]
Set Variable [ $r; Value:MBS( "WinSendMail.SetText"; $email; Send::Text) ]
Set Variable [ $r; Value:MBS( "WinSendMail.Send"; $email ) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ Title: "Failed to send email"; Message: $r; Default Button: “OK”, Commit: “Yes”; Commit: “No” ]
Else
    Pause/Resume Script [ Duration (seconds): 2 ]
End If
Set Variable [ $r; Value:MBS( "WinSendMail.Release"; $email ) ]

See also

Example Databases

Created 28th February 2017, last changed 25th November 2019


WinSendMail.ClearRecipients - WinSendMail.GetSubject

Feedback: Report problem or ask question.