Send-Mail
Command Description
Send a mail to the specified email address. Return true if succeeds. Return false if fails
Command Prototype
bRet = Outlook.SendMail(account,arryTo,strTitle,strContent,strFormat,arryAttachment,arryCC,arrBCC)
Parameter Description
| Parameter | Required | Type | Default | Description | 
|---|---|---|---|---|
| account | True | string | "" | The sender's email address and must be the same as the address bound to Outlook | 
| arryTo | True | string | "" | Destination email address | 
| strTitle | True | string | "" | Email suject | 
| strContent | True | string | "" | The content of the email body | 
| strFormat | True | enum | "text" | Message format | 
| arryAttachment | True | array | ['''C:\Users'''] | Email attachment can be an array of multiple file routes or a single route | 
| arryCC | True | string | "" | CC email address can be an array containing multiple email addresses or a string of a separate email address | 
| arrBCC | True | string | "" | BCC email addresses, can be an array of multiple email addresses, or a string of a separate email address | 
return
bRet,The variable used to save the output of the command.
Demo
/*********************************send email************** ************************************ 
**Entry 1 
**      account--sender's email address, which must be the same as the email address bound to Outlook. 
**Entry 2 
**      arryTo--target email address. 
**Entry 3 
**      strTitle--The title of the message. 
**Entry 4 
**      strContent--mail body content. 
**Entry 5 
**      strFormat--mail format. 
**Entry 6 
**      arryAttachment--mail attachment, which can be an array containing multiple attachment paths, or an attachment path string.      
**Entry 7 
**      arryCC--Cc email address, which can be an array containing multiple email addresses, or a single email string.      
**Entry 8 
**      arrBCC--Bcc email address, which can be an array containing multiple email addresses, or a single email string.     
**Exit 
**      bRet--The variable to which the output of the function call is saved.      
*****************************************************************************************/ 
TracePrint "--------------------------------------------Send email (mail format txt) -----------------------------------------" 
bRet = Outlook.SendMail("lzz1712@outlook.com","liuzhizheng@laiye.com","Hello","Hello","text",@res"Save as.txt","531874815@ qq.com","") 
TracePrint "Output the result after sending the mail:"&CStr(bRet) 
TracePrint "----------------------------------------------------------------------------------------------------" 
  
TracePrint "--------------------------------------------Send Mail (Mail format html)--------------------------------------" 
bRet = Outlook.SendMail("lzz1712@outlook.com","liuzhizheng@laiye.com","Hello","Hello","html",@res"save as .txt","531874815@ qq.com","wangliang@laiye.com") 
TracePrint "Output the result after sending the mail:"&CStr(bRet) 
TracePrint "----------------------------------------------------------------------------------------------------"