Problem sending mail from MSACCESS to Outlook

Joined
Jul 12, 2005
Messages
6
Reaction score
0
Hi All,

I am trying to send an email from MSACCESS (VBA) . But the code is hanging. Please tell me what is wrong! in my code.

Dim strErrMsg As String 'For Error Handling
Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olMail As Outlook.MailItem

Set olNameSpace = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "(e-mail address removed)"
.Subject = "Test Mail"
.ReadReceiptRequested = False
.Send
End With

Thanks in advance
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top