phmg.net
当前位置:首页 >> 如何通过ExCEl VBA和Outlook实现自动发送邮件功能 >>

如何通过ExCEl VBA和Outlook实现自动发送邮件功能

可以直接使用API函数ShellExecute 复制下面的代码,直接粘贴到你的代码模块中,然后运行EmailSend即可看到效果。 Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal ...

以前研究过类似的,好像Outlook有防病毒保护,不允许直接由Vba发送邮件,会出现提示框的。只有人为按确认键后才能发送。所以我当时是用宏自动生成草稿,最后由人工统一发送。 当初也找到过第三方软件来解决这个问题,但现在忘了名称了。

Set olApp = CreateObject("Outlook.Application") Set newItem = olApp.CreateItem(olMailItem) newItem.To = "邮箱地址,多个地址以分号隔开" newItem.Subject = "abc" newItem.Body = "abc" newItem.Send

1.添加引用Microsoft Outlook 11.0 Object Library。(这里用的是Microsoft Outlook 2003) 2.定义发送邮件过程。 Public Sub SendEmail(Receiver As String, SubjectText As String, BodyText As String, AttachedObject As String) Dim Outloo...

参考下面的VBA代码 Sub Send_Email() Dim i As Integer Dim MyOutlookApp As Outlook.Application Dim MyFolder As Outlook.MAPIFolder Dim MyNewMail As Outlook.MailItem Dim MyAttachments As Outlook.Attachments '附件 Set MyOutlookApp = ...

当然可以的。

建议用易语言编写

Set OutlookApp = CreateObject("Outlook.Application") 挪到循环外面 Set MailItem = Nothing 挪到循环里面

Set olApp = CreateObject("Outlook.Application") Set newItem = olApp.CreateItem(olMailItem) newItem.To = "123@QQ.COM;456@QQ.COM" newItem.Subject ="abc" newItem.Body = "abc" newItem.Send

'将发件箱中的邮件发送出去 Sub subSendEmail() On Error Resume Next Dim fld_OutBox As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim myItem As Object Dim myItems() As Object Dim iIndex As Integer iIndex = 0 Dim n As Integer...

网站首页 | 网站地图
All rights reserved Powered by www.phmg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com