Newline in python

0

Hi

I have a Lambda function using python script to send email via SES. I need to add a new line between these two output variables so I added "\n" to script but it is not affecting the email in any way. Do you know how to create a new line?

subject = "Report!"

body = "DB is:''"+db_engine+"'',  Count  is:''"+str(rds_count)+"''"

message = {"Subject": {"Data":subject}, "Body":{"Html":{"Data": body}}}
1 Answer
1
Accepted Answer

Hello.

In your case, you are sending the message body in HTML, so I think you need to break lines with HTML tags.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses/client/send_email.html

I think that line breaks can be created by using "<br>" as shown below.

body = "DB is:''"+db_engine+"'',  <br> Count  is:''"+str(rds_count)+"''"
profile picture
EXPERT
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
profile pictureAWS
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions