Created
September 24, 2019 09:06
-
-
Save yum-dev/594d8e01ac4781883b79ab70bea69e08 to your computer and use it in GitHub Desktop.
Sending email to customer_care
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "[email protected]" | |
from_addr_password = "your_password" | |
to_addr = "[email protected]" | |
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