Sent Outlook draft from other Computer

笑着哭i 提交于 2019-12-25 01:07:04

问题


I got eMail account on Exchange Server and that situation. I start on my Computer outlook (connected to this Email) run this code. The Email will created and saved in drafts.Thats working fine.

Than i take my notebook (connected to the same account) and try to sent it from the drafts. Get error wrong email address but it looks like correct address "test@test.com". If i delete this and type one more time the same address from my keyboard "test@test.com" it works.I got Windows 7 ,`Outlook 2013 with disabled Cached Exchange Mode.

_OutlookApplication = New Microsoft.Office.Interop.Outlook.Application
Dim mailItem = CType(_OutlookApplication.CreateItem(OlItemType.olMailItem), MailItem)

mailItem.Recipients.Add("test@test.com")
mailItem.Body ="Text"
mailItem.Subject = "Subject"
mailItem.Save()

Why should i retype the address? and how can i fix it?


回答1:


_OutlookApplication = New Microsoft.Office.Interop.Outlook.Application
Dim mailItem = CType(_OutlookApplication.CreateItem(OlItemType.olMailItem), MailItem)
Dim _TestRec As Recipient

_TestRec=mailItem.Recipients.Add("test@test.com")
_TestRec.AddressEntry.Address = "test@test.com"

mailItem.Body ="Text"
mailItem.Subject = "Subject"
mailItem.Save()

The problem is - mailItem.to setting only the Display Name. Had only to create a Recipient and set Recipient.AddressEntry.Address mailItem.Recipients.Add("test@test.com")



来源:https://stackoverflow.com/questions/21045026/sent-outlook-draft-from-other-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!