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}}}
sam15
已提问 4 个月前171 查看次数
1 回答
1
已接受的回答

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
专家
已回答 4 个月前
profile picture
专家
已审核 4 个月前
profile pictureAWS
专家
已审核 4 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则