text: import smtplib
  from email.mime.multipart import MIMEMultipart
  from email.mime.text import MIMEText
  from email.mime.image import MIMEImage
  
  # Email you want to send the update from (only works with gmail)
  fromEmail = 'moticasadomotica@gmail.com'
  # You can generate an app password here to avoid storing your password in plain text
  # https://support.google.com/accounts/answer/185833?hl=en
  fromEmailPassword = 'BeNq_42?'
  
  # Email you want to send the update to
  toEmail = 'Rafaelaleman1988@gmail.com'
  
  def sendEmail(image):
  	msgRoot = MIMEMultipart('related')
  	msgRoot['Subject'] = 'Security Update'
  	msgRoot['From'] = fromEmail
  	msgRoot['To'] = toEmail
  	msgRoot.preamble = 'Raspberry pi security camera update'
  
  	msgAlternative = MIMEMultipart('alternative')
  	msgRoot.attach(msgAlternative)
  	msgText = MIMEText('Smart security cam found object')
  	msgAlternative.attach(msgText)
  
  	msgText = MIMEText('<img src="cid:image1">', 'html')
  	msgAlternative.attach(msgText)
  
  	msgImage = MIMEImage(image)
  	msgImage.add_header('Content-ID', '<image1>')
  	msgRoot.attach(msgImage)
  
  	smtp = smtplib.SMTP('smtp.gmail.com', 587)
  	smtp.starttls()
  	smtp.login(fromEmail, fromEmailPassword)
  	smtp.sendmail(fromEmail, toEmail, msgRoot.as_string())
  	smtp.quit()
  