本文整理汇总了Python中mail.Mail.set_subject方法的典型用法代码示例。如果您正苦于以下问题:Python Mail.set_subject方法的具体用法?Python Mail.set_subject怎么用?Python Mail.set_subject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mail.Mail
的用法示例。
在下文中一共展示了Mail.set_subject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from mail import Mail [as 别名]
# 或者: from mail.Mail import set_subject [as 别名]
def main(args):
print args
global content
param_count = len(args)
if param_count < 2:
print 'do not have email params'
return
if param_count < 3:
print 'do not have content words'
return
to_mail_list = args[2].split(',')
mail = Mail()
mail.set_to_list(to_mail_list)
mail.set_subject("热词")
mail.send_text_mail(content)
示例2: main
# 需要导入模块: from mail import Mail [as 别名]
# 或者: from mail.Mail import set_subject [as 别名]
def main(args):
"""["attachment_mail.py", "[email protected]", "1.txt", "this is a test args"]"""
param_count = len(args)
filename = ''
content = ''
if param_count == 1:
print 'do not have email params'
return
if param_count == 2:
print 'do not have attachments params'
return
if param_count >= 3:
"""file path"""
filename = args[2]
if not os.path.exists(filename):
print 'dattachments not exist'
return
if param_count == 4:
content = args[3]
to_mail_list = args[1].split(',')
mail = Mail()
mail.set_to_list(to_mail_list)
mail.set_subject("详情")
mail.send_attachment(content, filename)