gpt4 book ai didi

vbscript - 是什么导致 Outlook 2007 提示 "A program is trying to send an e-mail message on your behalf?"

转载 作者:行者123 更新时间:2023-12-01 01:18:54 24 4
gpt4 key购买 nike

我在 Outlook 中内置了一个自定义表单,可以在任何更改时发送电子邮件通知。由于表单的规范,我不得不在表单中添加一些 VBScript(不幸的是)在表单的关闭事件上发送电子邮件。

该表格目前已发布并且运行良好。唯一出现的问题是 我是唯一的用户 使用表格 出现以下对话框提示:

enter image description here

使用该表单的其他人都无法获得该对话框。 此对话框强制您等到进度条完成,然后才“允许”您发送电子邮件(大约 5 秒)。 是因为我是出版商吗?还是我遇到的客户端设置? 如何禁用这只小狗?

如果其相关,请引用来源:

Sub SendAttach() 
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0

'Create a new message
set objOutlk = createobject("Outlook.Application")
set objMail = objOutlk.createitem(olMailItem)
objMail.To = Item.UserProperties("Assigned To")
objMail.cc = Item.UserProperties("Bcc")

'Set up Subject Line
objMail.subject = "Work Order Notifications: " & Item.UserProperties("Work Order Number") & " - " & _
Item.UserProperties("Subject") & " Due " & Item.UserProperties("Due Date")

'Add the body
strMsg = Item.UserProperties("Specifications") & vbcrlf
strMsg = strMsg & Item.UserProperties("Constraints")

objMail.body = strMsg
objMail.display 'Use this to display before sending, otherwise call objMail.Send to send without reviewing

objMail.Send
'Clean up
set objMail = nothing
set objOutlk = nothing
End sub

这里的安全不是问题。如果有人设法开始从我的工作站发送电子邮件,那么我遇到的问题比电子邮件欺骗要大得多!

作为旁注,我无法决定 SO 或 SU 是解决这个问题的最佳地点。如有必要,请相应地重定向。

最佳答案

我在尝试完成一些稍微不同的事情时遇到了这个问题,但为此目的是相同的。 HK 提供的链接可以很好地阅读并有助于了解正在发生的事情,但最终我选择不使用页面上讨论的任何选项。相反,我保持简单并决定让 Outlook 认为我正在发送电子邮件而不是自动过程,我这样做是通过将 objMail.Send 替换为 SendKeys 替代来模仿自己按下发送按钮,有点丑但有效就我而言。

编辑:

您可以使用此 sendkeys 语句:

SendKeys "%{s}", 1

这基本上调用 Alt + S 触发 Outlook 发送按钮。

关于vbscript - 是什么导致 Outlook 2007 提示 "A program is trying to send an e-mail message on your behalf?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10455665/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com