簡體   English   中英

沒有從Excel-VBA發送電子郵件的權限

[英]No permissions to send email from Excel-VBA

我曾經從Excel工作簿從VBA發送電子郵件。 這是正確的。 現在,我有一台新的PC,並嘗試運行相同的代碼。 而且我得到一個權限錯誤。 我已經使用舊PC進行了檢查,重新檢查和再次檢查,但是設置沒有任何區別。 不在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

在我的舊PC上,郵件已發送。 在我的新PC上,我得到:

Uw bericht heeft enkele of alle geadresseerden niet bereikt。

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

德意志民族解放運動:

  '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. 

診斷貝格犬:


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

Exchange-antwoordheaders:請求ID:09cc6cb4-af3f-4613-ac6a-4bb18046bd0e X-Server應用程序:Exchange / 15.20.2157.000 X-FEServer:AM0PR02CA0053 X-BEServer:AM0PR08MB4387 X-CalculatedBETarget:AM0PR08MB4387.eurprd08.prod.outlook。 -RequestId:{F6762D9D-3507-476D-93ED-008D1A05C6A3}:108 X-ClientInfo:{17B3EEB2-65A2-4317-8132-4E5BAD253A55}:241960014 X-ElapsedTime:1430 X-BackEndHttpStatus:200 X-ResponseCode:0 X- DiagInfo:AM0PR08MB4387 X-RequestType:執行


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反應:

外部索引:5外部索引:ropTransportSend(74)Microsoft.Exchange.Data.Storage.SendAsDeniedException:無法傳輸發送消息。 ---> Microsoft.Mapi.MapiExceptionSendAsDenied:MapiExceptionSendAsDenied:無法傳輸發送消息。 (hr = 0x80070005,ec = 1244)診斷上下文:盒蓋:35250
蓋子:36674 dwParam:0xA蓋子:61250 dwParam:0x0蓋子:45378 dwParam:0x2蓋子:44866 dwParam:0x46C蓋子:36674 dwParam:0xE蓋子:61250 dwParam:0x0蓋子:45378 dwParam :: 44x00蓋子55847 EMSMDBPOOL.EcPoolSessionDoRpc被稱為[length = 1049]蓋子:43559 EMSMDBPOOL.EcPoolSessionDoRpc返回了[ec = 0x0] [length = 148] [latency = 0]蓋子:52176 ClientVersion:15.20.2157.0蓋子:50032 ServerVersion:15.20.2157.6000 Lid: 35180
蓋子:23226 --- ROP解析開始---蓋子:27962 ROP:ropSetProps [10]蓋子:27962 ROP:ropFlushRecipients [14]蓋子:31418 --- ROP Parse Done ---蓋子:35250
盒蓋:36674 dwParam:0xA盒蓋:61250 dwParam:0x0盒蓋:45378 dwParam:0x2盒蓋:44866 dwParam:0x46盒蓋:36674 dwParam:0x4A盒蓋:61250 dwParam:0x0盒蓋:45378 dwBamd :: 4416 dwBamd:0x4 55847 EMSMDBPOOL.EcPoolSessionDoRpc被稱為[length = 172]蓋子:43559 EMSMDBPOOL.EcPoolSessionDoRpc返回了[ec = 0x0] [length = 368] [latency = 0]蓋子:52176 ClientVersion:15.20.2157.0蓋子:50032 ServerVersion:15.20.2157.6000蓋子: 35180
蓋子:23226 --- ROP解析開始---蓋子:27962 ROP:ropSetProps [10]蓋子:27962 ROP:ropTransportSend [74]蓋子:17082 ROP錯誤:0x4DC
蓋:44949
盒蓋:21921 StoreEc:0x4DC
蓋子:27962 ROP:ropExtendedError [250]蓋子:1494 ----遠程上下文請求----蓋子:38698
蓋:37692
蓋:37948
蓋子:33852 dw參數:0x0消息:SMTP蓋子:56248 StoreEc:0x4DC
盒蓋:40748 qdw參數:0xB01000000000001盒蓋:57132 qdw參數:0x0
盒蓋:63016 dw參數:0x4A盒蓋:39640 StoreEc:0x4DC
蓋:45434蓋:00011788-362d-8c85-0000-000000000000蓋:10786 dwParam:0x0消息:15.20.2157.000:AM0PR08MB4387:74f6b60d-ca04-46c4-80ff-8a31bf2a4ef7蓋:1750 ----遠程上下文結束--- -蓋子:31418 ---完成ROP分析---蓋子:22753
盒蓋:21817 ROP失敗:0x4DC
蓋:59285
盒蓋:46997 StoreEc:0x4DC
在Microsoft.Mapi.MapiBase.ThrowIfError(字符串消息,Int32 hr)在Microsoft.Mapi.Mapi.MapiExceptionHelper.ThrowIfError(String message,Int32 hresult,IExInterface iUnknown,Exception innerException,MapiStore mapiStore)在Microsoft.Mapi.MapiMessage.TransportSendMessage(PropValue [ ]&propsToReturn)Microsoft.Exchange.Data.Storage.MapiAccessor.TransportSendMessage(Object mapiObject,ExTimeZone時區,PropertyDefinition []&propertyDefinitions,Object []&propertyValues)---內部異常堆棧跟蹤的結尾---在Microsoft。 Exchange.Data.Storage.MapiAccessor.TransportSendMessage(Object mapiObject,ExTimeZone時區,PropertyDefinition []&propertyDefinitions,Object []&propertyValues)在Microsoft.Exchange.Data.Storage.CoreItem.TransportSend(PropertyDefinition []&屬性,Object []和值)在Microsoft.Exchange.RpcClientAccess.Handler.Message.TransportSend()在Microsoft.Exchange.RpcClientAccess.Handler.RopHandler。<> c__DisplayClass154_0.b__0()在Microsoft.Exchange.RpcClientAccess .Handler.ExceptionTranslator.TryExecuteCatchAndTranslateExceptions [TResult](Func 1 protectedCode, Func 2 errorCodeExtractor,Boolean noThrow,TResult&結果,Exception&異常,ErrorCode&errorCode)

Transportverzending錯誤:foutopsomming(25),HResult(0x00000000),EC(1244)。 Transportverzending錯誤:foutopsomming(22),HResult(0x00000000),EC(1244)。 Berichtverzending錯誤:bericht-id(4),foutopsomming(13),HResult(0x80070005),EC(1244)。

這意味着您(當前配置文件用戶)無法代表指定用戶發送。 嘗試注釋掉設置SentoObehalfOfName屬性的行,然后查看消息是否通過。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM