Skip to main content

Download-Attachment

Command Description

Download the attachment from the email

Command Prototype

arrayRet = Mail.DownloadAttachment(objMail,mailJSONObject,sAttrPath)

Parameter Description

ParameterRequiredTypeDefaultDescription
objMailTrueexpressionobjMailMailbox object, the mailbox object returned by the command Connect Mailbox (Mail.Connect)
mailJSONObjectTrueexpression{}Use the Mail.GetMailList command to return the mail objects in the mail array
sAttrPathTruepath'''C:\Users'''For the path saved in the mail attachment, you can fill in the absolute path or use @ res "path" to represent the path under the res folder of the current process. The path separator needs to be escaped, such as "C:\Laiye RPA" or @res"Laiye RPA\Laiye RPA"

return

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

Demo

TracePrint("--------------------------Download attachments------------------- --------") 
//-------------------------------------------------------------------------------
//[Note] Download the attachment in the email.
//Input parameter 1:
// objMail--mailbox object. Note: Mailbox object, the mailbox object returned by the Mail.Connect command
// mailJSONObject--mail object. Note: Use the Get Mail List (Mail.GetMailList) command to return the mail object in the mail array
// sAttrPath--path where email attachments are saved. Note: The path for saving email attachments can be filled in the absolute path or the path under the res folder of the current process in the form of @res "path". The path separator needs to be escaped, such as "C:\Laiye RPA" or @res "Laiye RPA\Laiye RPA"
//out parameters:
// objMail--The variable to which the output of the function call is saved.
//Command prototype: arrayRet = Mail.DownloadAttachment(objMail,mailJSONObject,sAttrPath)
arrayRet = Mail.DownloadAttachment(objMail,arrayRet[0],'''C:\Users''')