0
나는 python을 사용하여 전자 메일을 보내는 스크립트를 작성했습니다. 스크립트가 작동하고받는 사람이 전자 메일을 받았습니다. 그러나, 나는 CC에 나 자신을 지켰다. 그리고 나는 이메일을 얻지 않았다. 그리고, 나의 전망은 그 이후 일하는 것을 그만 뒀다.python 전자 메일 보내기 스크립트를 실행 한 후 Outlook이 작동을 멈 춥니 다?
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def success_email():
sender = '[email protected]'
recipients = '[email protected]'
CC = '[email protected]'
subject = "Load Balance Request Completed"
msg = MIMEMultipart('alternative')
msg['Subject'] = subject
msg['From'] = sender
msg['To'] = recipients
msg['CC'] = CC
# Create the body of the message (a plain-text and an HTML version).
text = 'Hi this is a test mail'
# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(text.encode('utf-8'), 'html')
# Attach parts into message container.
msg.attach(part1)
s = smtplib.SMTP('mail1.xyz.com')
x =s.sendmail(sender, recipients, msg.as_string())
print x
action = 'Success email sent for'
print action
success_email()