Skip to content

Instantly share code, notes, and snippets.

@yum-dev
Created September 24, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yum-dev/594d8e01ac4781883b79ab70bea69e08 to your computer and use it in GitHub Desktop.
Save yum-dev/594d8e01ac4781883b79ab70bea69e08 to your computer and use it in GitHub Desktop.
Sending email to customer_care
import smtplib
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# from email.mime.base import MIMEBase
# from email import encoders
smtp_server = 'smtp.gmail.com'
smtp_port = 587
from_addr = "your_address@gmail.com"
from_addr_password = "your_password"
to_addr = "care@livpuresmart.com"
while True:
msg = MIMEMultipart()
msg['From'] = from_addr
msg['To'] = to_addr
msg['Subject'] = "Installation"
body = "When will the device be installed. Please let me know and please call me back at 0000000000. Your customer care is really pathetic. " \
"XXXXXX from your customer care team hangs up the call." \
"XXXX XXXXX doesn't reply properly. Such a bad customer care service it is. WORST EVER"
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP(smtp_server, smtp_port)
server.starttls()
server.login(from_addr, from_addr_password)
text = msg.as_string()
server.sendmail(from_addr, to_addr, text)
server.quit()
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment