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 Resposta
1
Resposta aceita

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
ESPECIALISTA
respondido há 4 meses
profile picture
ESPECIALISTA
avaliado há 4 meses
profile pictureAWS
ESPECIALISTA
avaliado há 4 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas