访问电子邮件 [英] Email in Access

查看:132
本文介绍了访问电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


是否可以从Access发送电子邮件?我发现一篇关于

的微软文章如何做到这一点,但我一直收到错误RUNTIME ERROR 438 - 对象

不支持此属性或方法。下面列出了来自

microsoft的文章

如何使用记录集将Outlook电子邮件发送给多个收件人

Microsoft Access
http://support.microsoft.com/?id= 318881


非常感谢任何和所有帮助


Argus

Hello All,

Is it possible to send an email from Access? I found a Microsoft article on
how to do this but I keep getting an error "RUNTIME ERROR 438" -- Object
doesn''t support this property or method. Listed below is the article from
microsoft

How to use a recordset to send Outlook e-mail to multiple recipients in
Microsoft Access
http://support.microsoft.com/?id=318881

Any and all help is greatly appreciated

Argus

推荐答案

不。显然是不可能的。


太棒了。如何向我们展示您的代码?或者为什么不搜索NG。我在这上面发了一大堆垃圾。
发布了一大堆垃圾。有一个非常好的例子
www.amazecreations.com/downloads


这个NG中有数百个例子。你要做的就是

现在弄清楚如何使用网站上的搜索功能。

Nope. patently impossible.

Great. how about showing us your code? Or why not search the NG. I
posted a whole bunch of junk on this. There''s a really nice example on
www.amazecreations.com/downloads

There are literally hundreds of examples in this NG. All you gotta do
now is figure out how to use the search features on the website.


我发现这个代码片段效果很好,但仅限于一(1)To,

一(1)CC和一(1)BCC。你可以帮我修改它至少包括每个三(3)
三(3)。如果没有,那么每个人必须做一个(1)。


我不需要附件部分所以我评论它以防万一。


在一个模块中,我粘贴了以下代码,然后从一个RunCode中调用它

SendEMail()在一个宏中


函数SendEMail ()

Dim strTo As String,strSubject As String,_

varBody As Variant,strCC As String,_

strBCC As String,strAttachment作为String,_

strAttachment1 As String,strAttachment2 As String,_

strAttachment3 As String,strAttachment4 As String


strTo = 您的收件人电子邮件到此处

strCC ="您的CC收件人电子邮件到此处

strBCC ="你的BCC电子邮件就在这里

strSubject ="你的主题在这里

varBody ="正文发送到这里

''如果需要,添加更多strattachments并修改下面的IF语句

''strAttachment =" attachment1"

''strAttachment1 =" attachment2"

''strAttachment2 =" attachment3"

''strAttachment3 =" attachment4"

''strAttachment4 =" attachment5"

''启动Outlook

Dim olApp作为Outlook.Application

设置olApp = CreateObject(" Outlook.Application")


''登录

Dim olNs作为Outlook.NameSpace

设置olNs = olApp.GetNamespace(" MAPI")

olNs.Logon


''发送消息

Dim olMail作为Outlook.MailItem

设置olMail = olApp.CreateItem(olMailItem)

''填写并发送消息

ol Mail.To = strTo

olMail.CC = strCC

olMail.BCC = strBCC

olMail.Subject = strSubject

olMail.Body = varBody

''如果需要更多附件,修改这些陈述

''如果Len(strAttachment)< 0那么

''olMail.Attachments.Add(strAttachment)

''如果Len(strAttachment1)< 0那么

''olMail.Attachments.Add(strAttachment1)

''如果Len(strAttachment2)< 0那么

''olMail.Attachments.Add(strAttachment2)

''如果Len(strAttachment3) )< 0然后

''olMail.Attachments.Add(strAttachment3)

''如果Len(strAttachment4)< 0那么

''olMail.Attachments.Add(strAttachment4)

''结束如果

''结束如果

''结束如果

''结束如果

'结束如果


olMail.Send


设置olNs = Nothing

设置olMail = Nothing

设置olApp = Nothing


结束功能


< pi ******** @ hotmail.comwrote in消息

news:11 ******************** @ b28g2000cwb.googlegrou ps.com ...
I found this code snip that works very well, but limited to only one (1) To,
one (1) CC, and one (1) BCC. Can you help me modify it to include at least
three (3) for each. If not then one (1) for each would have to do.

I didn''t need the attachment part so I commented it out just in case.

In a module, I pasted the following code and then called it from a RunCode
SendEMail() in a macro

Function SendEMail()
Dim strTo As String, strSubject As String, _
varBody As Variant, strCC As String, _
strBCC As String, strAttachment As String, _
strAttachment1 As String, strAttachment2 As String, _
strAttachment3 As String, strAttachment4 As String

strTo = "Your recipient email goes here"
strCC = "Your CC recipient email goes here"
strBCC = " Your BCC email goes here"
strSubject = "Your Subject goes here"
varBody = "Body text goes here"
'' Add more strattachments if needed and modify IF statement below
''strAttachment = "attachment1"
''strAttachment1 = "attachment2"
''strAttachment2 = "attachment3"
''strAttachment3 = "attachment4"
''strAttachment4 = "attachment5"
''Start Outlook
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")

''Logon
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon

''Send a message
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
''Fill Out and Send Message
olMail.To = strTo
olMail.CC = strCC
olMail.BCC = strBCC
olMail.Subject = strSubject
olMail.Body = varBody
'' Modify these statements if more attachmewnts are needed
''If Len(strAttachment) <0 Then
'' olMail.Attachments.Add (strAttachment)
'' If Len(strAttachment1) <0 Then
'' olMail.Attachments.Add (strAttachment1)
'' If Len(strAttachment2) <0 Then
'' olMail.Attachments.Add (strAttachment2)
'' If Len(strAttachment3) <0 Then
'' olMail.Attachments.Add (strAttachment3)
'' If Len(strAttachment4) <0 Then
'' olMail.Attachments.Add (strAttachment4)
'' End If
'' End If
'' End If
'' End If
'' End If

olMail.Send

Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing

End Function

<pi********@hotmail.comwrote in message
news:11********************@b28g2000cwb.googlegrou ps.com...

不。显然是不可能的。


太棒了。如何向我们展示您的代码?或者为什么不搜索NG。我在这上面发了一大堆垃圾。
发布了一大堆垃圾。有一个非常好的例子
www.amazecreations.com/downloads


这个NG中有数百个例子。你要做的就是

现在弄清楚如何使用网站上的搜索功能。
Nope. patently impossible.

Great. how about showing us your code? Or why not search the NG. I
posted a whole bunch of junk on this. There''s a really nice example on
www.amazecreations.com/downloads

There are literally hundreds of examples in this NG. All you gotta do
now is figure out how to use the search features on the website.



" ; OdAwG" < Od *** @ goneloose.com写信息

新闻:CA ******************* @ tornado.texas.rr.com ...
"OdAwG" <Od***@goneloose.comwrote in message
news:CA*******************@tornado.texas.rr.com...

>我发现这段代码剪辑非常有效,但仅限于一(1)To,

one (1)CC和一(1)个BCC。你可以帮我修改它至少包括每个三(3)
三(3)。如果没有,那么每个人必须做一个(1)。
>I found this code snip that works very well, but limited to only one (1) To,
one (1) CC, and one (1) BCC. Can you help me modify it to include at least
three (3) for each. If not then one (1) for each would have to do.



在所有三种情况下,你只需用分号分隔收件人,你就可以

拥有你想要的任意数量。


-

Rick Brandt,Microsoft Access MVP

电子邮件(视情况而定)至...

Hunter dot的RBrandt

In all three cases you just separate the recipients with semi-colons and you can
have as many as you want.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


这篇关于访问电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆