Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2009
    Posts
    15

    Unanswered: how to bypass the message "a program is trying to send an e-mail on your behalf"

    Hi all,

    We have an application created from Access 97. There is a part of the system where it sends email to recipient automatically. It work fine on Outlook 97 before but when we updated to Outlook 2000/2003 and 2007, this message keeps on appearing "a program is trying to send an e-mail address on your behalf". How can I change my code inorder to bypass this message.

    Thanks for your help.
    jopax_0429@yahoo.com

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Yes. Do a search through these threads on Outlook and emailing. I recall last year I posted several posts in a thread about this.

    There is a work-around but it's very difficult (Microsoft made it nearly impossible to do this without the message box appearing for some odd reason). The work-around involves some things you're networking person will need to make which most network admins don't like to do (as well as some code you'll need to make).

    There are some settings you can make in the docmd.sendobject but you'll still get the message (which is associated with the attachment).

    Anyway, I'm not sure where that set of threads is on this forum but maybe search for my threads and you'll find it.

    You might also want to look at what format your attachment is. I 'believe' if you make your attachment snapshots, you won't get this error but I can't be sure.

    Good luck - this is one of those problems which no on has found an easy solution to yet. I personally installed a program called: "Blat" which is a simple emailing program that accomplishes the same thing and works quite well (it can be installed along with Outlook installed) and will send emails as if they were Outlook emails. There's about a half page of coding to send the email using Blat (which is also posted somewhere on this forum.)
    Last edited by pkstormy; 02-09-10 at 07:04.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Oct 2004
    Location
    Oxfordshire, UK
    Posts
    89
    On a standard XP setup with Office 2003, no. Many moons ago it was one of the major gotchas which occured when applying a service pack which addressed the issue of MAPI/Outlook being hijacked by malicious code - if I remember rightly, that was Office 2000 SP2.

    However, there's a work around if the e-mail is sent in response to user inputs such as a command, toolbar, or ribbon button click. You can create an e-mail in code and display it rather than send it. Then the user clicks on the send button. This can be useful if the user didn't mean to do it - selling an annoyance as a feature!

    I've attached a class module which allows you to do this. Here's how you might use it:

    Public Sub TestEMail()
    On Error GoTo Err_TestEMail
    Dim objEMail As clsEMail

    Set objEMail = New clsEMail
    With objEMail
    .SendTo = "joe.bloggs@someisp.com"
    .Subject = "Test E-Mail"
    .Body = "This is test of objEMail"
    .Attachment = "C:\Test.pdf"
    .Display
    End With

    Exit_TestEMail:
    Exit Sub

    Err_TestEMail:
    MsgBox Name & "_Resize Error: " & Err.Number & ": " & Err.Description
    Resume Exit_TestEMail
    End Sub

    I've done some testing In Access 2007 with Outlook 2007 on Vista, and the Send method adds the e-mail to the Outbox without display the "A programme is trying to automatically send email on your behalf..." prompt. However, the file is "trusted" and I'm logged on to the pc user an administrator account so...
    Attached Files Attached Files
    Last edited by MyNewFlavour; 02-09-10 at 07:30. Reason: Incorrect statement

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    MyNewFlavor,

    Yes - I did the same thing and was successful by logging in as admin. However I could never make it so a non-admin user could automatically send the email with the attachment and not see the popup box (for non-trusted designated attachments such as an Access report or query created dynamically). As you stated, this was a Service Pack fix for 2000 (SP2) that actually started causing the problem with Outlook.

    Maybe I'm misunderstanding your post but are you meaning that you found a way to automatically "silently" send an attachment in 2000 without the user ever seeing the popup message? I don't want user's to actually see the email (and have to click send) since it's automatically generated and silently sent.
    Last edited by pkstormy; 02-09-10 at 08:08.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Oct 2004
    Location
    Oxfordshire, UK
    Posts
    89
    Yes and No. Asyou know, prior to SP2 the in built command sent the e-mail silently After that, no. With the module, if the user isn't logged on using an administrator account, the work around is to create the e-mail in code by pressing a button on a form. The Display method means the e-mail pops up and the user sends it - better than getting a prompt about security.

    The could be useful if what you want to do is say e-mail a report as a PDF attachment to a customer with standard subject and body, immediately after you're entered data in a form. You can do this manually by clicking a button open a named report that's available when the form's open, choose send to email, fill in subject and header, and e-mail address, and then send it to the customer, but the user would have to step through each bit. You could save the export routine (in Access 2007) but that's for each customer so...

    This module wouldn't be useful for looping through records if the user isn't logged on as an administrator. However, as with any method, if the routine was in a helper application scheduled on a machine that was logged with administrator priviledeges or trusted credentials you could do what you liked e.g. the server where the back end lives. You could create pending e-mail records and files used to create the e-mails and send them when the schedule runs, say every 10mins...much like Outlook used to. The records would be written in the front end. It's a bit ugly since the application is one mmore thing to maintain & would have to be loaded on start up to be effective.

    Of course everything changes if you've got a SQL backend...
    Last edited by MyNewFlavour; 02-09-10 at 08:50.

  6. #6
    Join Date
    Jan 2010
    Posts
    20
    I had the same problem with my automatic sending of email last year. The message you're getting has to do with a dll called Redemption. Go to the Microsoft website and search for Redemption.dll. Once you download it to your machine it should take care of the issue. At least it took care of mine.

    I have also attached the auto generating email code I used.

    Hope it helps!
    Attached Files Attached Files

  7. #7
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267

  8. #8
    Join Date
    May 2006
    Posts
    386
    Dear All, on the very same topic, I was wondering whether one of you be kind of enough to guide me through on how to set up or write a code in ms access database to send automated reminders through ms outlook.

    Basically, i want to the database to send 3 different reminders at different intervals. For example if a student has not returned the borrowed books back to the library 30 days after it was taken, the system should bring up a popup screen informing the user that "would you like to allow this reminder to be sent to x or y" if clicked yes, then the body of email should include the folloing information so the student will know what we are chasing him for:

    Date book was taken NameOfBook FeePaid FinedAmount

    Any advice on this would be highly appreciated.
    Emi-UK
    Love begets Love, Help Begets Help

  9. #9
    Join Date
    May 2006
    Posts
    386

    Can Anyone help on how to write a code to send automated email reminders

    Dear All,

    My manager has been asking me for this for months but I never managed to get this working.

    I was wondering whether someone would be kind enough to guide me through on how to set up or write a code in MS Access database to send automated email reminders through ms outlook.

    Basically, I want to the database to send 3 different reminders at different intervals. For example if a student has not returned the books back to the library 30 days after it was taken, the system should bring up a popup screen informing the user that "would you like to allow this reminder to be sent to x or y" Also the user should be able see what is being sent before clicking Yes or NO. if clicked yes, then the body of email should include the following
    information so the student will know what we are chasing them for:

    Date book was taken NameOfBook FeePaid FinedAmount

    Any advice on this would be highly appreciated.
    Emi-UK
    Love begets Love, Help Begets Help

  10. #10
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I've got some code to determine "Reminders" that need to be retrieved for a specific task (on a specific date) but you'll need to stay posted on the code bank for "reminders" coding to retrieve and return reminders that need to be done. "Reminder coding" is something that should be setup to coincide with the table structure and specific to the program. I can post an example soon that you'll be able to tweak and fit your needs.
    Last edited by pkstormy; 03-01-10 at 22:41.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •