Skip to main content


Command Description

Send a mail to the specified email address

Command Prototype

bRet = Mail.SendEx(sServer,iPort,bSsl,sUid,sPwd,sSender,sTo,sCc,sTitle,sContent,sAttr)

Parameter Description

sServerTruestring""SMTP server address
iPortTruenumber25SMTP server port, commonly seen as 25, 465 and 587
bSslTruebooleanNoneWhether to use SSL for encryption. The default value is false
sUidTruestring""Email login account
sPwdTruestring""Login password
sSenderTruestring""Sender email address
sToTruestring""The recipient's email address (multiple addresses can be filled in in the form of an array of ["",""])
sCcTruestring""When you cc email address, you can fill in multiple addresses in the form of array ["",""]
sTitleTruestring""Email suject
sContentTruestring""The body content of the mail, supporting the HTML format
sAttrTruearray['''C:\Users''']For email attachments, multiple attachments can be filled in in the form of ["attachment 1 path", "attachment 2 path"] array


bRet,The variable used to save the output of the command.


TracePrint("--------------------------Send Email------------------- --------") 
//[Remarks] Send an email to the specified email address.
//Input parameter 1:
// sServer--server port. Note: SMTP server address
// iPort--server port. Note: SMTP server port, commonly 25, 465, 587
// bSsl--SSL encryption. Note: Whether to use SSL protocol encryption, the default is no
// sUid--Login account. Note: Email login account, for example, the login account of ordinary QQ mailbox is the same as the email address
// sPwd--login password. Note: login password
// sSender--Sender. Note: sender's email address
// sTo--Recipient. Note: Recipient email address, multiple addresses can be filled in the form of ["", ""] array
// sCc--Cc people. Note: CC email address, multiple addresses can be filled in the form of ["", ""] array
// sTitle--mail title. Note: the subject of the email
// sContent--mailbox content. Note: The body content of the email, supports HTML type body content
// sAttr--mailbox attachment. Note: Email attachments, multiple attachments can be filled in the form of ["Attachment 1 Path", "Attachment 2 Path"] array
//out parameters:
// bRet--The variable to which the output of the function call is saved.
//Command prototype: bRet = Mail.SendEx(sServer,iPort,bSsl,sUid,sPwd,sSender,sTo,sCc,sTitle,sContent,sAttr)
bRet = Mail.SendEx("",465,true,sUid,sPwd,sSender,sTo,sCc,"mail title","mail content",[@res"first attachment.txt "])