python发送文件到邮箱_在Python中保存到.msg文件,或者将邮件发送到文件系统

是的,这是可能的。

有用于这些目的的模块,称为MSG PY。

例如:from independentsoft.msg import Message

from independentsoft.msg import Recipient

from independentsoft.msg import ObjectType

from independentsoft.msg import DisplayType

from independentsoft.msg import RecipientType

from independentsoft.msg import MessageFlag

from independentsoft.msg import StoreSupportMask

message = Message()

recipient1 = Recipient()

recipient1.address_type = "SMTP"

recipient1.display_type = DisplayType.MAIL_USER

recipient1.object_type = ObjectType.MAIL_USER

recipient1.display_name = "John Smith"

recipient1.email_address = "John@domain.com"

recipient1.recipient_type = RecipientType.TO

recipient2 = Recipient()

recipient2.address_type = "SMTP"

recipient2.display_type = DisplayType.MAIL_USER

recipient2.object_type = ObjectType.MAIL_USER

recipient2.display_name = "Mary Smith"

recipient2.email_address = "Mary@domain.com"

recipient2.recipient_type = RecipientType.CC

message.subject = "Test"

message.body = "Body text"

message.display_to = "John Smith"

message.display_cc = "Mary Smith"

message.recipients.append(recipient1)

message.recipients.append(recipient2)

message.message_flags.append(MessageFlag.UNSENT)

message.store_support_masks.append(StoreSupportMask.CREATE)

message.save("e:\\message.msg")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值