To use this function add it to the class library file named OrchestratorService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorService.ts
Functions: SendEMailWithAttachment
Description: The following is the script to send an e-mail with an attachment.
publicSendEMailWithAttachment(strSubject:string,strToAddress:string,strContent:string,strAttachmentFileName:string,strAttachmentFileContent:string):void{
letobjMimeAttachment:MimeAttachment=newMimeAttachment();
objMimeAttachment.name=strAttachmentFileName;
objMimeAttachment.content=strAttachmentFileContent;
letobjEmailMessage:EmailMessage=newEmailMessage();
objEmailMessage.fromAddress="orchestrator@cloudbuildtools.com";
objEmailMessage.fromName="Orchestrator";
objEmailMessage.smtpHost="smtp.cloudbuildtools.com";
objEmailMessage.smtpPort="25";
objEmailMessage.subject=strSubject;
objEmailMessage.toAddress=strToAddress;
objEmailMessage.addMimePart(strContent,"text/html");
objEmailMessage.addMimePart(objMimeAttachment,"application/json; charset=UTF-8");
objEmailMessage.sendMessage();
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
