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개 답변
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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠