Send an e-mail through a macro and by pass security settings
Asked Answered
M

1

0

I am using Office 365 for MS Access and MS Outlook. I have a macro that, upon opening, fires off queries and attempts to e-mail the last query.

However, when I do, it prompts me with a dialog box that says:

A program is trying to send an email message on your behalf, If this is unexpected, click Deny and verify your antivirus software is up-to-date.

For more information about email safety and how you might be able to avoid getting this warning, click Help.

Allow    Deny    Help

So far, I've tried this:

https://www.youtube.com/watch?v=3D8M3jo0a7U

Where you go into your MS Outlook settings and turn off warnings. However, it still gives me the same error.

Any ideas?

~~EDIT~~

Adding solution ideas as I attempt them. The following list are failures:

In Outlook: Trust Center -> Programmatic Access -> Disable all security
In MS Access: Trust Center -> Macro Settings -> Enable all macros
Run the registery edit to run system in Admin and try the query again.

Milissa answered 13/11, 2019 at 20:42 Comment(5)
I use Access 2010 and I don't get this message if my Windows anti-virus protection is current.Necker
@Necker Anti-virus is up to date. Also, I added a third edit to what I tried, using regedit.Milissa
How are you sending the e-mail? I use CDO.Message to send e-mail from VBA to O365 with no problems.Brag
I am using the EmailSendObject macro within Access. I will look into CDO.Milissa
Does this answer your question? How to avoid Outlook security alert when reading outlook message from C# programRapeseed
C
0

The professional way to send emails via Access is to bypass Outlook and use either CDO or vbSendmail...

Count answered 14/11, 2019 at 11:19 Comment(3)
Ok, I've tried this for a while now and I continue to get this error: Run-time error '-2147220978 (8004020e); The server rejected the sender address. The server response was: Client was not authetnicated to send anonymous mail during MAIL FROM Deleted some details as I wasn't sure if something would indicate my particular server.Milissa
Do you have Exchange...you have to setup a receive connector to whitelist the IPs that try to send the email and get blocked.Count
I do indeed have Exchange. Will try this suggestion.Milissa

© 2022 - 2024 — McMap. All rights reserved.