0
이메일을 보내기 위해 파이썬 라이브러리가 내장되어 있습니다. 내가 보내는 메시지에 시간을 넣을 때를 제외하고는 모두 작동합니다. 은 7:30 pm
입니다.파이썬 SMTP 라이브러리 비어있는 이메일
전자 메일 메시지에 시간을 넣으면 전자 메일 수신자가 빈 전자 메일을 받게됩니다. 시간을 없애면 이메일이 정상적으로 전송됩니다. 나는 그 시간에 뭔가가 이메일을 망칠 것이라고 생각하고있다. 코드에서 무엇을 변경해야합니까? 그래서 전자 메일 본문에 시간을 할애 할 수 있습니다. 감사!
from smtplib import SMTP
def sendEmail(message,address):
debuglevel = 0
smtp = SMTP()
smtp.set_debuglevel(debuglevel)
#connect to the email server
smtp.connect('smtp.gmail.com', 587)
smtp.starttls()
smtp.login('[email protected]', 'ourpassword')
#set the email to be sent from
from_addr = "Auto Notification <sender email>"
#send the email from our address and the message and recepients provided in the function definition.
smtp.sendmail(from_addr, address, message)
smtp.quit()
finalStr = "The Girls Varsity Basketball has been changed to 02/06/2018 at 7:30 pm * - (previously 6:15 pm ) at Clear Lake High School"
sendEmail(finalStr, '[email protected]')
당신은 이메일의 원시 소스 봤어? 그 것도 비어 있습니까? 나는 왜 전자 메일이 시간 때문에 비어있는 지 이유를 생각할 수 없다. – Barmar
유일한 차이점은 줄이 더 낮지 만 그렇지 않으면 똑같은 것처럼 보입니다. @Barmar – LewisCallaway
좋은 이메일이나 나쁜 이메일은 줄이 낮습니까? 헤더와 메시지 본문 사이에 빈 줄이 있어야합니다. 빈 줄에는이 내용이 없습니다. – Barmar