Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop Access "Outlook is trying to send and Email...."

Status
Not open for further replies.

CptCrusty1

Programmer
Feb 17, 2005
216
US
I have a process which emails a text file through Access. Before the email can go out tho, I get a message saying something like "A program is trying to automaticly send email on you're behalf, do you want to allow this?"

How do I get past this message?
 
This has also come up very many times. Just search these fora.
 
Do a google search for outlook object model guard

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I have used click yes also. Only thing I didn't like about it was it won't work when the PC is locked.
 
You should use the "Outlook Security template" which you can find in the Office resource kit. You can download the office resource kit from the microsoft website.
 
You are using the frace .SenderName if you drop the sendername your msg should also stop

Herman
Say no to macros
 
One thing I fogot was using ASPEmail.dll. Basic features are free and it works great. I use it on a DB that runs 24/7 emailing reports.
 
All....

I REALLY appreciate the help on this. However, my boss found out what I was up to and advised me that our IT dpt has specificly locked down all pc's in our company from being able to perform operations like this. Only 5 pc's out of 1500 are alowed to perform this operation. Thus, my process will have to run on his PC, in the wee early morning hours when know one is around, and when the PC invariably is locked.

If there was a way around that, it would be pretty cool, but I'd probably get in a spot of trouble with the IT guys (and gals).
Thanks
Richard.
 
It may be your company has no real concern about you working around the security 'features' of Outlook but they have concern about giving you a less secure version.

It could be that there are a handful of computers left with less restricted security (Outlook 2000 before SP <1 or was it 2?> or earlier). That version of Outlook does not prompt with that message. That is the cheapest and least hassle of sending messages, without the message box slowing you down. All the other methods involve some other kind of coding and your mileage may vary. I have not tried any of them out personally. I guess the question I'd be asking is, are the computers just updated for security and therefore that is why you must use a different computer OR is there some other reason they do not want you to send out e-mails yourself. There may legal issues or concerns about tying up the internet pipe for your company.

It may simply be that they have one of theses workarounds already that includes some sort of licensing and they only bought 5 licenses. Although with 1500 computers, I bet concerns about the internet pipe are very real. Also keep in mind that the latter versions of Outlook are more secure and slightly more idiot proof. I would not roll out the old version of Outlook company wide.

If your company doesn't have an issue with you sending e-mails, explore one of the options mentioned above. Otherwise, I'd just find out about using one of the 5 special computers. Also keep in mind that they all probably involve money or installing something on one of the servers so you will either need money or IT help (or both). Also if your machines are really locked down, you may need someone to install software for you. At any rate, I'd ask your IT department about it if your boss doesn't know and won't get the answer.
 
leummens,

I'm looking at Advanced Security for Outlook as it caught my attention as one of the things I was unaware of. Are you using docmd.sendobject to send messages and if so how did you configure it to work? What version of Access are you using?

It looks nice if it works... and it's free.
 
Here is some of my code... at least the important part....

Code:
Dim strSubject As String        
Dim strBody As String       
Dim strRecipient As String  
Dim objOutlook As Outlook.Application   
Dim objEmail As Outlook.MailItem
Dim strTo, strCC, strTestAddr As String

'create and send email
With objEmail
    .To = strTestAddr
    .Subject = strSubject
    .Body = strBody
    .Attachments.Add "C:\Documents and Settings\rkline\My Documents\HelloCalls.txt"
    .Send
End With

'close outlook
Set objEmail = Nothing

All of the variables work correctly, i.e. strSubject, yadda yadda, for filling in the TO,Subject,Body, and attachments attributes. It email is sent with, essentially:
[blue]objEmail.send[/blue]

Should I be using a different way to send the email?

Thanks
Rich
 
First, your code has nothing to do with whether or not you get the stupid message box.

Assuming that HelloCalls.txt is not generated from the database, then that is the most efficient way to do it. If the file is exported from access, then using docmd.sendobject would be more efficient as it is all native Access code and does not require using automation (using another application directly as opposed to indirectly). Although "Advanced Security for Outlook" may require the code you used to work correctly... That is what I was trying to get at in my post about it. If you try it, I'd like to know the good the bad and the ugly on it.

That said, I'd only be concerned about efficiency if it is taking too long to process and therefore would not bother changing it. Also, Docmd.sendobject would make your database more portable just in case someone did not have the same or later version of Outlook installed and tried to use the function (References will not downgrade but will upgrade, also your code reuires Outlook and not Eudora or Pegasus or any other MAPI enabled Mail Client that would work with docmd.sendobject).

I'd also be curious about whether or not your company allows you to send the e-mail or not.
 
What happens if you replace this:
.Send
with this ?
.Display

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
What I expect will happen is that the message will pop up with no box and he will have to hit send to send the message. That however does not send the message which is still a problem for many people I'm sure (including me).
 
Hello All;

I've been under the weather so I haven't had a chance to try all the cool suggestions. One thing however, is that I cannlt download anything to the PC. Actually, I can, but I should be careful. I have Admin rights on my own PC, but not over the network.

It looks like everyone has some good ideas. I'll check them out and see what comes up (or doesn't LOL).

Rich.
 
hermanlaksko,

Helen's solution is not the same as the question here as I understand it... It is an example of addressing and displaying an e-mail messae instead of sending one (basically what PHV said). If I remember her articles correctly, she recommends Redemption to deal with it. Or maybe it was just advertised in one of the newsletters Access Watch is a member of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top