有条件地阻止 Outlook 根据发件人和收件人地址发送电子邮件
我在 Outlook 2007 中设置了多个邮件帐户(例如,[电子邮件受保护] 、[电子邮件受保护]等)。有时,通常是由于自动完成功能的原因,我会错误地从 [email protected] 发送至仅应接收来自 [电子邮件受保护] 的邮件的收件人)。
发件人(我选择的邮件帐户)和收件人(收件人或抄送)电子邮件地址之间的这些限制通常可以通过域名来定义。
例如,[电子邮件受保护] 不应发送到recipient-domainX.com &收件人域Y.com。并且 [email protected] 不应发送到recipient-domain1.com &收件人域2.com。
因此,最好在 VBA 脚本或文本文件中显式定义或“硬编码”每个邮件帐户的这些域限制。
那么,如何使用 VBA 或其他方式实现对电子邮件地址的检查,以防止在违反这些限制之一时发送电子邮件。
也欢迎其他更优雅的解决方案。
谢谢。
I have multiple mail accounts setup in Outlook 2007 (e.g., [email protected], [email protected], etc.). Occasionally, usually as the result of the Auto Complete feature, I will mistakenly send email from [email protected] to a recipient that should only be receiving mail from [email protected]).
These restrictions between from (my selected mail account) and recipient (To or CC) email addresses can generally be defined by domain name.
For example, [email protected] should not send to recipient-domainX.com & recipient-domainY.com. And [email protected] should not send to recipient-domain1.com & recipient-domain2.com.
So it would be fine to explicitly define or "hardcode" these domain restrictions per mail account in a VBA script or text file.
So how, using VBA or other means, can I implement a check of the email addresses, to prevent an email from being sent if one of these restrictions is being violated.
Open to other more elegant solutions as well.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可以让您按地址筛选电子邮件。我对此并没有太多的功劳,它主要是在线发布的几个不同的代码合并为一个。无论如何,它运行良好,应该可以让你到达你想要的目标的一半。我们公司使用此功能将所有外部发送的电子邮件发送到公共文件夹 HR 评论中。
This lets you screen emails out by address. I can't claim much credit for this, it's largely several different codes posted online merged into one. Regardless, it works solid and should get you half way to where you want to be. This is used in our company to send all externally sent emails into a public folder HR reviews.
我修改了代码,使其更易于阅读,实际上相同的代码只是更整洁一些。
I've modified the code to be slightly easier to read, effectively the same code just a little neater.