trying to send mail from Access via outlook ; no errors , but no mail either

J

J Bard

trying to send mail from Access via outlook ; no errors , but no mail either


Private Sub Command0_Click()
Dim oa As Outlook.Application
Dim ns As Outlook.NameSpace
Dim mi As Outlook.MailItem

Set oa = New Outlook.Application
Set ns = oa.GetNamespace("mapi")
Set mi = oa.CreateItem(olMailItem)

mi.To = "(e-mail address removed)"
mi.Subject = "test"
mi.Body = "a test"
mi.Send

Set oa = Nothing
Set ns = Nothing
Set mi = Nothing
 
T

TC

Just a guess, but, is the mail hanging around in the "to be sent" folder?
(or whatever that's called in Outlook)

HTH,
TC
 
J

J Bard

YES

Thanks very much ....boy do I feel silly with this ...I often forget Outlook
Express ( which I use) aint the same thing as Outlook....
I'll poke around in some docs as to how to get it to actually "send ".....
 

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