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
preguntada hace 4 meses171 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace 4 meses
profile picture
EXPERTO
revisado hace 4 meses
profile pictureAWS
EXPERTO
revisado hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas