如何在Outlook中使用python将电子邮件发送给收件人并将收件人作为Microsoft邮件? [英] How to send email using python in outlook with recipient as microsoft mail?

查看:71
本文介绍了如何在Outlook中使用python将电子邮件发送给收件人并将收件人作为Microsoft邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在发送带有我的Outlook的电子邮件时遇到问题.每个电子邮件地址都类似于"xxx@example.com",就我而言,这只是没有完整电子邮件的名称,而python不只接受名称,我也无法发送电子邮件.请协助.

I'm having issue with sending an email out with my outlook. Every email address are like 'xxx@example.com', for my case, it's just names without a full email, and python don't accept names only, and I can't send out email. Please assist.

import win32com.client

olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "test"
newMail.Body = "test"
newMail.To = "Vick Peh"

newMail.Send()

推荐答案

如果您的地址为@您的其他地址,请尝试右键单击并将其另存为您的个人地址.从那里,您将能够检索收件人的"Internet电子邮件".复制并粘贴"Internet电子邮件"和TADA〜

If your address is @ your other address, try to right click and save as your personal address first. From there, you'll be able to retrieve the 'Internet Email' for the recipient. Copy and paste the 'Internet Email' and TADA~

这篇关于如何在Outlook中使用python将电子邮件发送给收件人并将收件人作为Microsoft邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆