You need to send SEVERAL emails with specific content for each person and you don't want to do it by hand? This could help you!
- Create a excel table (.xlsx) like this 📁:
Name | Message | Personal Info | |
---|---|---|---|
name 1 | email1 | message 1 | information 1 |
name 2 | email2 | message2 | information 2 |
name 3 | email3 | message3 | information 3 |
- Configure some parts of the code 👨🏽💻
# I. Configure your message in create_message function:
def create_message(name, message, personal_info):
return f'''
<p>Olá {name}, </p>
<p>{message}</p>
<p>{personal_info}<p>
'''
# II. Configure your email credentials in envia_email function:
def envia_email(corpo_email, dest):
-> msg['Subject'] = 'Email Subject here'
-> msg['From'] = '[email protected]'
-> password = "****" # Enter your password here
- It's Done! ✅