0

I am trying to see the options to send the tabular data to an email. I cannot use AWS SNS since SNS cannot format the data.

Can we utilize the AWS SES to send the tabular data to the email ? If yes, could someone explain how to achieve the same.

Following is the image contains the data printed from python 3.x code output, I want to send the same information with the same tabular format over the email:

enter image description here

karthik
  • 417
  • 1
  • 7
  • 15

1 Answers1

0

SNS and SES are both transport mechanisms. SNS sends messages to a variety of places and SES uses SMTP to send messages. Neither, in and of themselves, can format a message for you.

What you want is to use HTML to send the message via SES or SNS. This post shows how to use HTML mail with Python and this post, while not answered, has some great code to show you the HTML email and sending via SES.

You'll likely need a HTML table element inside of your HTML which lives inside of the Python code that runs in Lambda. The Lambda could take the data from SNS and format it into the table. None of this is super hard but it is code you'll have to write.

stdunbar
  • 16,263
  • 11
  • 31
  • 53