通过电子邮件发送多个联系人并附加特定于每个联 [英] Email multiple contacts and attach a report specific to each contact

查看:153
本文介绍了通过电子邮件发送多个联系人并附加特定于每个联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Access 2007中有一个连续的表单,列出了不同代理商的联系人。每条记录都有一个复选框,我可以使用该复选框为所有选定的联系人生成群发邮件?它是通用的,没有主题,没有附件,也没有消息,适合日常使用。但是,数据库所有者还希望能够使用此表单上的复选框通过电子邮件将报告发送给每个联系人(要求他们验证和更新其信息)。


理想情况下,他们会选择他们想要发送电子邮件的联系人,点击电子邮件信息更新表?按钮并让Outlook向每个联系人发送一封电子邮件,其中附有联系信息报告。 (我可以解决这些电子邮件是自动发送还是稍后进行审核的问题?我真的只是想把报告附在每封电子邮件中。)


这就是我所拥有的 -


这段代码(很粗略)会打开多封电子邮件,但数量似乎有限。但我可以让报告附加到多个记录 - 在点击按钮时具有焦点的记录(这就是为什么它被注释掉了):

展开 | 选择 | Wrap | 行号

解决方案

不知道问题的原因,我无法解决发布的代码问题,它'在论坛帖子中调试代码的问题太复杂了。这就是访问具有调试工具的原因,因此您可以看到代码在执行时正在执行的操作,并且您可以说明为什么它在您编写代码时没有按照您的想法执行操作。


不是我的强项,但我时不时地讨论这种东西。

我不知道我做的是最佳,最佳实践与否。我确实尝试以最佳方式做事,但我的基本理念是,如果它有效并且它的性能是可以接受的,那么就转到下一个项目。


无论如何这里是我过去做过的事情,也许你可以在这里找到有用的东西?


也许你输出报告作为文件,然后将文件附加到电子邮件

展开 | 选择 | Wrap | 行号


@Delerna


我正试图绕开保存每个报告,因为数据库中有大约400个联系人。


另外我不认为我的用户会想要找到40个报告并将它们附加到他们想要每月发送的40封电子邮件中(他们想要发送400个) 40)波浪中的电子邮件。


我非常相信用户不愿意这样做,因为我已经建立了一种方式,一次向一个联系人发送一封电子邮件,并自动附上报告(使用SendObject方法),并且不够很容易对他们来说


因此我的批量要求。啊,我喜欢用户...


我实际上建议您以编程方式将文件附加到电子邮件中,类似于您尝试使用报告或可能通过CDO。我并不是建议你的用户去找他们并附上它们。如果我是一个用户,我也会对此感到厌恶!


但是,如果你说它不起作用那么它就不会工作......其他人?

I have a continuous form in Access 2007 that lists contacts for different agencies. Each record has a checkbox that I can use to generate a mass email to all selected contacts ? it?s generic with no subject, no attachments and no message, for everyday use. However, the database owners would also like the ability to email a report to each contact (asking them to verify and update their information) using the checkboxes on this form.

Ideally, they would select the contacts they wanted to email, click the ?Email Info Update Form? button and have Outlook send out an email to each of the contacts with their Contact Info Report attached. (I can address whether the emails go automatically or get reviewed later ? I?m really just interested in getting the report attached to each email.)

Here''s what I have-

This code (it''s rough) opens multiple emails, although there seems to be a limit to the quantity. But I can'' get the report to attach to more than one record-the one that has the focus at the time the button is clicked (that''s why it''s commented out):

Expand|Select|Wrap|Line Numbers

解决方案

Don''t know the cause of your issues and I couldn''t problem solve the posted code, it''s too complicated a problem to debug code in a forum post. That''s why access has a debugging tool, so you can see what the code is doing as it is being executed and you can tell why it''s not doing what you thought it would do when you wrote it.

Not my strong point either but I dabble with this sort of stuff every now and then.
I don''t know if what I do is optimal, best practise or not. I do try to do things optimally but my underlying philosophy is if it works and it''s performance is acceptable then that will do, move on to the next project.

Anyway here is something I have done in the past that maybe you can find usefull here ??

Maybe if you output the report as a file and then attach the file to the email

Expand|Select|Wrap|Line Numbers


@Delerna
I''m trying to get around saving each report, as there are around 400 contacts in the database.

Plus I don''t think my users are going to want to go find 40 reports and attach them to the 40 emails they want to send out monthly (they want to send the 400 emails in waves of 40).

I''m fairly certian of the user''s reluctance to this, because I already built in a way to send an email to one contact at a time with the report attached automatically (using the SendObject method), and that''s not "easy enough" for them.

Hence my quest to do it by bulk. Ah, I love users...


I was actually suggesting that you programmatically attach the files to the emails similar to what you are trying to do with the report or perhaps via CDO. I was not suggesting for your users to go find them and attach them. If I was a user I would baulk at that too!

However if you say it won''t work then it wont work...... Anyone else?


这篇关于通过电子邮件发送多个联系人并附加特定于每个联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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