Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

How sending attachment from vCO server per mail

$
0
0

Hi All,

 

I try to send an attachment from my vCO server. I have a csv file which will be created from a workflow and I will send this file as attachment per mail.

 

I found this here --> https://communities.vmware.com/thread/440886?start=0&tstart=0

 

But can somebody help me how I can implamented  this here "reseourceElement.getContentAsMimeAttachment() method" in the "Send notification" workflow: I try this here, but it is not working how I need it.

var message = new EmailMessage();
// Override default settings if and only if input parameter is set
if ( smtpHost != null && smtpHost.length > 0 ){
message.smtpHost = smtpHost;
}
if ( smtpPort != null && smtpPort > 0 ){
message.smtpPort = smtpPort;
}
if ( username !=null && username.length > 0){
message.username = username;
}
if ( password != null && password.length > 0){
message.password = password;
}
if ( fromName != null && fromName.length > 0){
message.fromName = fromName;
}
if ( fromAddress != null && fromAddress.length > 0){
message.fromAddress = fromAddress;
}
message.toAddress = toAddress;
message.subject = subject;
message.addMimePart(content,"text/html; charset=UTF-8");
//Create Attachment
var fileAttachment = new MimeAttachment();
fileAttachment.name = attachmentName;
fileAttachment.content = attachment;
message.addMimePart(fileAttachment,"text/html; charset=UTF-8");
System.log( "sending mail to host: " + message.smtpHost + ":" + message.smtpPort + " with user:" + message.username   + ", from:" + message.fromAddress + ", to:" + message.toAddress );
message.sendMessage

 

Thanks.


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>