I'm new to python so take it easy
I have an email script that i've recently wrote, but struggling to add to body or attach an photo to it
Its to become part of a bigger script to take a picture and email to myself when some presses the door bell
my code
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mine.text import MIMEText
from email.mine.image import MIMEImage
Subject = ''
Text = ''
msg = MIMEMultipart()
message = 'Subject: {}\n\n{}'.format(Subject, Text)
msg.attach(MIMEText(message))
mailserver = smtplib.SMTP(host,port_number)
mailserver.ehlo()
mailserver.starttls()
mailserver.ehlo()
mailserver.login(username, password)
mgs = ""
mailserver.sendmail(my_email,their_email,message)
mailserver.quit()
any help would be happily accepted I've tried few tutorials but dont seam to follow same coding path as my original script
many thanks