Using CDO Email within Access

S

scott

I registered the old cdo.dll version 1.21 in an attempt to email through
outlook 2003 and suppress the Warning. However my code gives me an error on
the 1st line. Can anyone point me to the correct syntax for using CDO email?


CURRENT CODE ************************

Dim objMail As New Mail Class

Dim Success As Long
Const MAIL_SYS_CDO = -1
Const BODY_STYLE_HTML = 1

With objMail

.RecipientAdd "Scott", "(e-mail address removed)", "SMTP", 1, False
.RecipientAdd "Scott 2", "(e-mail address removed)", , , False
.AttachmentAdd "c:\temp\myfile.pdf"
.MsgSubjectText = "CDO Test"

.MsgBodyText = "<html><body><b>Test html email
body</b></body></html>"
.MsgSaveCopy = False
.SendMail MAIL_SYS_CDO, BODY_STYLE_HTML
Success = .Result
End With
 

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