Solved

Error handling while sending an email from MS Access

Posted on 2009-07-06
11
244 Views
Last Modified: 2012-05-07
Hi
when sending email from MS access, A dialog appears asking some program is trying to access outlook and do you want to continue. In that Dialog, If I click know , I am getting runtime error.
Could anyone please help me how to handle that error
Please find the screeshot attached.

Thanks
email-send-from-MS-Access.JPG
0
Comment
Question by:kusumdv
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 24786286
Hello kusumdv,

That is an Outlook security measure implemened starting in Outlook 2000 SP2, and persisting
at least through 2002 and 2003.

To disable it, I've used three products:

1) Express ClickYes
http://www.contextmagic.com/express-clickyes/
There is a free version and a Pro version for ~$30 with more features.  I've used the pro version.
It works as advertised.  I'm not using it currently.  I'm using the MAPILab product instead.

2) MAPILab Advanced Outlook Security
http://www.mapilab.com/outlook/security/
A free COM add-in for Outlook.  I am using it now and I like it

3) Redemption
http://www.dimastr.com/redemption/
A DLL you can use in your code to disable the warnings.  Free download, but you must pay a
license to distribute.  I've used it and like it.

Now, if you want an error handler, please post your code.

Regards,

Patrick
0
 
LVL 10

Expert Comment

by:therealmongoose
ID: 24786290
It's an in buit "Feature" that microsoft installed after the I Love You virus went round... There's a free download which works very well that get's around this....
 
http://www.mapilab.com/outlook/security/
 
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 24786334
You would have to put an error handler in your code

On Error GoTo ErrorTrap

'your code

Exit Sub 'or Function

ErrorTrap:

If Err.Num = 2293
    MsgBox "E-mail not sent.", vbCritical
    Err.Num = 0
    Resume Next
Else
    Exit Sub 'or Function
End if
End Sub
 
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 38

Expert Comment

by:Jim P.
ID: 24786362
Or the other is to send your e-mail via SMTP and skip outlook completely:

Access to Word Mail Merge to E-Mail
http://www.experts-exchange.com/Q_23257730.html#21180796
0
 

Author Comment

by:kusumdv
ID: 24787669
When I use the below code:

You would have to put an error handler in your code

On Error GoTo ErrorTrap

'your code

Exit Sub 'or Function

ErrorTrap:

If Err.Num = 2293
    MsgBox "E-mail not sent.", vbCritical
    Err.Num = 0
    Resume Next
Else
    Exit Sub 'or Function
End if
End Sub
 
I am getting Run-time error which says:
Run-time error: 438
Object doesnot support this property or method.
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 24787744
Can you tell us on what line it is occurring and what is highlighted?
0
 

Author Comment

by:kusumdv
ID: 24787826
please find the screeshot
email-send-from-MS-Access1.JPG
0
 
LVL 38

Accepted Solution

by:
Jim P. earned 500 total points
ID: 24787955
Ok, sorry Typo

it should be err.Number

And the
On Error GoTo ErrorTrap
 
'your code
 
Exit Sub 'or Function
 
ErrorTrap:
 
If Err.Number= 2293
    MsgBox "E-mail not sent.", vbCritical
    Err.Number= 0
    Resume Next
Else
    msgbox Err.Number & ": " & err.Description 
    Exit Sub 'or Function
End if
End Sub

Open in new window

0
 

Author Closing Comment

by:kusumdv
ID: 31600207
thanks. its working. by the way u missed "Then" in the "If" clause
0
 
LVL 10

Expert Comment

by:therealmongoose
ID: 24788009
Handling the error will let the code continue, but does not get around the problem of the email not being sent - in order to get around the message completely you need to install one of the suggested programs or use smtp as per the above posts....
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 24788033
>> by the way u missed "Then" in the "If" clause

You're right, but this is aircode. Generally I code that you will never have to error handle like this. I'll go and do direct SMTP code. I force the users into the slot and fire the code. they don't get a chance to stop it.

Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question