MIMEText doesn't accept the Name parameter
This commit is contained in:
parent
e9d4ed3911
commit
ce42f5aada
1 changed files with 4 additions and 0 deletions
|
@ -168,6 +168,10 @@ class MailOutPlugin(MailPlugin, ABC):
|
|||
elif _type == 'text':
|
||||
_type_class = MIMEText
|
||||
|
||||
args = {}
|
||||
if _type_class != MIMEText:
|
||||
args['Name'] = os.path.basename(file)
|
||||
|
||||
with open(file, 'rb') as f:
|
||||
return _type_class(f.read(), _subtype, Name=os.path.basename(file))
|
||||
|
||||
|
|
Loading…
Reference in a new issue