Send-Mail
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
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sServer | True | string | "" | SMTP server address |
iPort | True | number | 25 | SMTP server port, commonly seen as 25, 465 and 587 |
bSsl | True | boolean | None | Whether to use SSL for encryption. The default value is false |
sUid | True | string | "" | Email login account |
sPwd | True | string | "" | Login password |
sSender | True | string | "" | Sender email address |
sTo | True | string | "" | The recipient's email address (multiple addresses can be filled in in the form of an array of ["abc@ui.bot","xyz@ui.bot"]) |
sCc | True | string | "" | When you cc email address, you can fill in multiple addresses in the form of array ["abc@ui.bot","xyz@ui.bot"] |
sTitle | True | string | "" | Email suject |
sContent | True | string | "" | The body content of the mail, supporting the HTML format |
sAttr | True | array | ['''C:\Users'''] | For email attachments, multiple attachments can be filled in in the form of ["attachment 1 path", "attachment 2 path"] array |
return
bRet,The variable used to save the output of the command.
Demo
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 ["abc@ui.bot", "xyz@ui.bot"] array
// sCc--Cc people. Note: CC email address, multiple addresses can be filled in the form of ["abc@ui.bot", "xyz@ui.bot"] 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("smtp.feishu.cn",465,true,sUid,sPwd,sSender,sTo,sCc,"mail title","mail content",[@res"first attachment.txt "])
TracePrint(bRet)