[英]Send Email outlook using Excel VBA
I am trying to send an email using Excel with this code:我正在尝试使用以下代码使用 Excel 发送 email:
Sub SEND_EMAIL()
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
' ADRESSE
olMail.To = "selojo7915@rippb.com"
' Subject
olMail.subject = "Line"
' BODY
olMail.body = "this"
olMail.Send
When starting this macro i have the following error启动此宏时出现以下错误
The error is in the last line (olMail.Send)错误在最后一行 (olMail.Send)
And every time i am trying to send an email outlook is starting to update and after a moment it's showing error每次我尝试发送 email outlook 都开始更新,过了一会儿就显示错误
Exception de HRESULT: 0x80004004 (E_ABORT) HRESULT 异常:0x80004004 (E_ABORT)
You see a security issue (earlier prompts) because Outlook is configured on the client computer in one of the following ways:您会看到一个安全问题(较早的提示),因为 Outlook 是通过以下方式之一在客户端计算机上配置的:
You can create a group policy to prevent security prompts from displaying if any up-to-date antivirus software is installed on the system or just turn these warning off (which is not really recommended).您可以创建一个组策略,以防止在系统上安装任何最新的防病毒软件时显示安全提示,或者只是关闭这些警告(不推荐这样做)。
Read more about that in the Security Behavior of the Outlook Object Model article. 在 Outlook Object Model 文章的安全行为中阅读更多相关信息。
You may consider using the following workarounds:您可以考虑使用以下解决方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.