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:
Back
Top