没有从Excel-VBA发送电子邮件的权限



我曾经从Excel工作簿从VBA发送电子邮件。这工作正确。 现在我有一台新电脑并尝试运行相同的代码。我收到权限错误。 我已经用我的旧电脑检查,重新检查并仔细检查,但我找不到设置的任何差异。不是在Excel中,也不是在Outlook中。 这是我尝试发送邮件时收到的邮件(我只是用 xxx@yyy,.nl 屏蔽了我的电子邮件地址)。

厌倦了每一个...什么都没用...

Sender = "<Support> support@xxx.com"
Set objMail = objOl.CreateItem(0)
With objMail
.Sentonbehalfofname = Sender
.Subject = qrySubj
.HTMLBody = "<HTML><BODY>" & Text & "</BODY></HTML>"
.DeleteAfterSubmit = False
.To = Receiver
.Send
End With

在我的旧电脑上,邮件已发送。在我的新电脑上,我得到:

Uw bericht heeft enkele of alle geadresseerden niet bereikt.

Onderwerp:    Dagelijkse rapportage mails
Verzonden:    13-8-2019 07:54

De volgende geadresseerde(n) zijn niet bereikt:

'xxx@yyy.nl' op 13-8-2019 07:54
Dit bericht is niet verzonden. U bent niet gemachtigd om het bericht namens de opgegeven gebruiker te verzenden. 

Diagnostische gegevens voor beheerders:


Fout 是 [0x80070005-0x000004dc-0x00000524]。

Exchange-antwoordheaders: 请求 ID: 09cc6cb4-af3f-4613-ac6a-4bb18046bd0e X-服务器应用程序:交换/15.20.2157.000 X-FEServer: AM0PR02CA0053 X-BEServer: AM0PR08MB4387 X-计算BETarget:AM0PR08MB4387.eurprd08.prod.outlook.com X-RequestId: {F6762D9D-3507-476D-93ED-008D1A05C6A3}:108 X-ClientInfo: {17B3EEB2-65A2-4317-8132-4E5BAD253A55}:241960014 X-经过时间:1430 X-BackEndHttpStatus: 200 X-响应代码:0 X诊断信息:AM0PR08MB4387 X-请求类型:执行


Overzicht van externe bewerkingen:

0: ropWriteStream (45) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 0
1: ropRelease (1) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 0
2: ropSetProps (10) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 0
3: ropFlushRecipients (14) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 0
4: ropSetProps (10) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 0
5: ropTransportSend (74) Verwerkt(1) Voltooid(0)
Resultaat van externe bewerkingen: 0
Reactiecodes: 1244

Uitzonderingen bij reacties:

Index van externe bewerkingen: 5 Gekoppelde externe bewerkingen: ropTransportSend (74) Microsoft.Exchange.Data.Storage.SendAsDeniedException:无法传输发送消息。---> Microsoft.Mapi.MapiExceptionSendAsDenied: MapiExceptionSendAsDenied: 无法传输发送邮件。(hr=0x80070005, ec=1244) 诊断上下文: 盖子: 35250
盖子: 36674 dw帕拉姆: 0xA 盖子: 61250 dw帕拉姆: 0x0 盖子: 45378 dw参数: 0x2 盖子: 44866 dw帕拉姆: 0x46C 盖子: 36674 dw帕拉姆: 0xE 盖子: 61250 dw帕拉姆: 0x0 盖子: 45378 dw帕拉姆: 0x471 盖子: 44866 dw帕拉姆: 0x236 盖子:55847 EMSMDBPOOL。EcPoolSessionDoRpc 调用 [length=1049] 盖子:43559 EMSMDBPOOL。EcPoolSessionDoRpc 返回 [ec=0x0][length=148][latency=0] 盖子: 52176 客户端版本: 15.20.2157.0 盖子: 50032 服务器版本: 15.20.2157.6000 盖子: 35180
盖子: 23226 --- ROP 解析开始--- 盖子: 27962 机械杆: 罗普设置道具 [10] 盖子: 27962 ROP: rop冲洗收件人 [14] 盖子:31418 --- ROP 解析完成--- 盖子: 35250
盖子: 36674 dw帕拉姆: 0xA 盖子: 61250 dw帕拉姆: 0x0 盖子: 45378 dw参数: 0x2 盖子: 44866 dw帕拉姆: 0x46 盖子: 36674 dw帕拉姆: 0x4A 盖子: 61250 dw帕拉姆: 0x0 盖子: 45378 dw帕拉姆: 0x4B 盖子: 44866 dw帕拉姆: 0x0 盖子:55847 EMSMDBPOOL。EcPoolSessionDoRpc 调用 [length=172] 盖子:43559 EMSMDBPOOL。EcPoolSessionDoRpc 返回 [ec=0x0][length=368][latency=0] 盖子: 52176 客户端版本: 15.20.2157.0 盖子: 50032 服务器版本: 15.20.2157.6000 盖子: 35180
盖子: 23226 --- ROP 解析开始--- 盖子: 27962 机械杆: 罗普设置道具 [10] 盖子: 27962 机械杆: 运输发送 [74] 盖子: 17082 ROP 错误: 0x4DC 盖子:
44949 盖子:
21921 商店EC: 0x4DC
盖子: 27962 ROP: rop扩展错误 [250] 盖子:1494 ---- 远程上下文乞求---- 盖子: 38698 盖子:
37692 盖
子: 37948 盖子:
33852 dw帕拉姆: 0x0 消息: SMTP 盖子: 56248 商店: 0x4DC
盖子: 40748 qdw帕拉姆: 0xB01000000000001 盖子: 57132 qdw帕拉姆: 0x0
盖子: 63016 dw帕拉姆: 0x4A 盖子: 39640 商店EC: 0x4DC
盖子: 45434 GUID: 00011788-362d-8c85-0000-0000000000000 盖子: 10786 dwParam: 0x0 Msg: 15.20.2157.000:AM0PR08MB4387:74f6b60d-ca04-46c4-80ff-8a31bf2a4ef7 盖子:1750 ---- 远程上下文结束---- 盖子:31418 --- ROP 解析完成--- 盖子: 22753 盖子:
21817 ROP 故障: 0x4DC 盖子:
59285
盖子: 46997 StoreEc: 0x4DC
at Microsoft.Mapi.MapiExceptionHelper.ThrowIfError(字符串消息, Int32 hresult, IExInterface iUnknown, Exception innerException, MapiStore mapiStore) at Microsoft.Mapi.MapiBase.ThrowIfError(String message, Int32 hr) at Microsoft.Mapi.MapiMessage.TransportSendMessage(PropValue[]& propsToReturn) at Microsoft.Exchange.Data.Storage.MapiAccessor.TransportSendMessage(Object mapiObject, ExTimeZone timezone, PropertyDefinition[]& propertyDefinitions, Object[]&propertyValues) ---内部异常堆栈跟踪结束--- at Microsoft.Exchange.Data.Storage.MapiAccessor.TransportSendMessage(Object mapiObject, ExTimeZone timezone, PropertyDefinition[]& propertyDefinitions, Object[]&propertyValues) at Microsoft.Exchange.Data.Storage.CoreItem.TransportSend(PropertyDefinition[]& properties, Object[]& values) at Microsoft.Exchange.RpcClientAccess.Handler.Message.TransportSend() at Microsoft.Exchange.RpcClientAccess.Handler.RopHandler.<>c__DisplayClass154_0.b__0() at Microsoft.Exchange.RpcClientAccess.Handler.ExceptionTranslator.TryExecuteCatchAndTranslateExceptions[TResult](Func1 protectedCode, Func2 errorCodeExtractor, Boolean noThrow, TResult& result, Exception& exception, ErrorCode&errorCode)

Transportverzending是mislukt: foutopsomming(25), HResult(0x00000000), EC(1244). Transportverzending是mislukt: foutopsomming(22), HResult(0x00000000), EC(1244). Berichtverzending是mislukt: bericht-id(4), foutopsomming(13), HResult(0x80070005), EC(1244).

这意味着您(当前配置文件用户)不能代表指定用户发送邮件。尝试注释掉设置SentoObehalfOfName属性的行,并查看消息是否通过。

最新更新