注册 登录
编程论坛 ACCESS论坛

[求助]如何向查询结果里的Email地址群发邮件?

weiw3 发布于 2006-06-14 20:18, 2061 次点击

请问一下大家,我要向我的客户数据库里有Email地址的客户发送资料。请问这样的功能如何实现?

例如说,我的客户数据库里有工程部门,市场部门等等。当我利用查询选出所有工程部门的记录,并且向他们发送Email。我能不能建一个按钮,将我查询到的所有结果里的Email地址传输到Outlook里,新建一封邮件,实现群发呢?还有一个小要求就是收件人不能看到我还将这个邮件发送给了其他的客户,也就是不显示收件人地址。

多谢了!

5 回复
#2
小笨笨2006-06-16 12:45
用asp或可以做,但是直接在access里做,我不会。
#3
weiw32006-06-16 17:36
你的意思是用ASP做一个插件,然后Access调用吗?
#4
icecool2006-06-16 21:58

<a href="mailto:abc@163.com;123@163.com;abs@163.com">发送邮件</a>

按这样的格式,将邮件地址用查询的结果变量代替,就可以全部发送了啊!

#5
weiw32006-06-16 22:12
我在微软的网站上看到了他们的范例,代码如下:

Sub SendMessage(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Nancy Davolio")
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
objOutlookRecip.Type = olCC

' Set the Subject, Body, and Importance of the message.
.Subject = "This is an Automation test with Microsoft Outlook"
.Body = "Last test - I promise." & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send

End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub

但是这个代码实现不了我要的功能。我要的是在我的Access客户数据库里查找出特定条件的收信人,比如说所有公司的CEO,然后将他们的Email地址传到Outlook,在Outlook里编辑好我的信件内容(包括添加附件),最后向他们群发。而上面的代码只能启动Outlook,并且从所有联系人中选出人来群发。这样的话还要再一个一个的点,太麻烦了。

帮看看,有什么办法改一改就能实现我要的功能的?还是要全部重新写啊?多谢了!!!
#6
weiw32006-06-18 19:14
顶一下!

各位帮看一看啊!谢了!
1