SMTP로 재생하고 email.mime을 사용하여 헤더 구조를 제공합니다. 어떤 이유로 특정 길이를 초과하는 머리글을 추가하려고하면 줄 바꿈이 내 머리글 행에 추가됩니다.email.mime을 사용할 때 전자 메일 헤더의 원하지 않는 줄 바꿈
from email.mime.text import MIMEText
message = 'some message'
msg = MIMEText(message)
msg.add_header('some header', 'just wondering why this sentence is continually cut in half for a reason I can not find')
print msg['some header']
print msg
인쇄 MSG의 [ '일부 헤더'] 인쇄 : -
some header: just wondering just wondering why this sentence is continually cut in half for a reason I can not find
인쇄 MSG 인쇄 : - 내가 발견 않았다
some header: just wondering why this sentence is continually cut in half for a
reason I can not find
것은 길이가되는이 절단 점입니다 off는 머리글 제목과 해당 값의 조합입니다. 그래서 'some header'를 'some'로 단락 시켰을 때, 줄 반환은 이전이 아닌 'reason'이후로 바뀝니다.
내보기 페이지 너비가 아닙니다. 실제로 전자 메일 헤더에 줄 바꿈 문자가있는 전자 메일을 보냅니다.
의견이 있으십니까?
참고 : http://www.ietf.org/rfc/rfc2822.txt 섹션 2.1.1은 78 줄의 권장 줄 길이를 설명하고 섹션 2.2.3은 줄 접기를 설명합니다. – Marty
@thomas 빠른 답장을 보내 주셔서 감사합니다. 새 줄을 강제로 적용하지 않도록 전자 메일 패키지를 재정의 할 수있는 방법이 있습니까? – user788462
@ Marty 마티에게 감사드립니다. – user788462