Sending email using python script

Hi all, :raised_hands:
I was looking for a solution to send emails during graph executions, and I came up with this one below. The code allows to send multiple email at once and it could be used for lots of stuff!

But before you start you’ll need to allow 3rd party app to use gmail. Hope you find it useful too! :peace_symbol:.

follow here:

1. open your gmail account settings

2. go to the security page

3. allow for less secure app

4. now you’re ready to go! :smiley: just copy paste the code below and customize it as you need

    import smtplib
    sender = ""
    receivers = ["", ""]
    password = "the password of your valid gmail account"
    subject = "sending email from Dynamo 😎"

    body = "the body of the email"

    email_text = """\
    From: %s
    To: %s
    Subject: %s

    """ % (sender, ", ".join(receivers), subject, body)

        server = smtplib.SMTP_SSL('', 465)
        server.login(sender, password)
        server.sendmail(sender, receivers, email_text)

        OUT = "email sent"

        OUT = "something went wrong"