I tried to send email using smtplib using smtplib in python. I created a object of MIMEMultipart and tried to send email but email is send with subject,to,from but there is no text sent with it. I tried following code
import smtplib as smtp
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart()
connection = smtp.SMTP_SSL('smtp.gmail.com', 465)
email_addr = 'example@gmail.com'
email_passwd = 'GoogleAppPassword'
connection.login(email_addr, email_passwd)
msg['Subject'] = "IMPORTANT"
msg['From'] = "example@gmail.com"
msg['To'] = "person@gmail.com"
msg['text'] = "hi"
connection.sendmail(email_addr,"person@gmail.com", msg.as_string())
connection.close()
Can you spot where i went wrong.