cancel
Showing results for 
Search instead for 
Did you mean: 

Sending outlook mail with excel attachment in sap robotic process automation

indranilbiswas
Advisor
Advisor
0 Kudos

Hi All,

I am executing a process and result is getting recorded in an Excel File. Now I want to attach this Excel file and send it to mail via Outlook. How can I do that ? Please share example.

Regards

Indranil

View Entire Topic
  // Initializes “Microsoft Outlook” application.
  ctx.outlook.init();
  // Creates a basic mail.
  ctx.outlook.mail.create({
		To:'to@mail.com', 
		Cc:'cc@mail.com', 
		Subject:'subject'
	})
  ctx.outlook.mail.setBodyHtml(0,'body');
  ctx.outlook.mail.attach(0, 'D:\\test.xlsx');
  try {
  // Sends the mail.
  var res = ctx.outlook.mail.sendUsingAccount(0, 'send@mail.com');
  } catch (err) {
    return e.error.KO;
  }
  // Ends “Microsoft Outlook” application.
  ctx.outlook.end();
Jerome
Advisor
Advisor
0 Kudos

Hi,

You can also find a sample on the Store in the Factory. It presents you how to deal with such common use cases

J.