Robert L. Stewart
rl_stewart at highstream.net
Mon Mar 8 14:15:43 CST 2004
Paul, copy the vbsendmail.dll into the windows\system directory START | RUN | regsvr32.exe vbsendmail.dll Then set a reference to it in your VBA code using TOOLS | REFERENCES (it will start with SMTP) I tested it on my computer and it worked perfectly with the code someone else posted for you. Robert At 12:00 PM 3/8/2004 -0600, you wrote: >Message: 6 >Date: Mon, 8 Mar 2004 10:05:29 -0500 >From: "Mike & Doris Manning" <mikedorism at adelphia.net> >Subject: RE: Re: [AccessD] vbSendMail - Using with Access >To: "'Access Developers discussion and problem solving'" > <accessd at databaseadvisors.com> >Message-ID: <000001c4051e$cbbe4a60$9f194244 at hargrove.internal> >Content-Type: text/plain; charset="iso-8859-1" > >Did you set a reference to the DLL? > >Doris Manning >Database Administrator >Hargrove Inc. >www.hargroveinc.com > > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of >paul.hartland at fsmail.net >Sent: Monday, March 08, 2004 9:47 AM >To: Access Developers discussion and problem solving >Subject: Re: Re: [AccessD] vbSendMail - Using with Access > > >To all, > >This is my code I currently have for the VBSendMail.dll : > >Public poSendmail As vbSendMail.clsSendMail ' Used for the vbSendMail >funtion (email directly to SMTP server). > >Function SendEmail() > ' **** SEND THE EMAIL MESSAGE DIRECTLY THROUGHT THE SMTP SERVER >(primary) **** > > Set poSendmail = New vbSendMail.clsSendMail > > poSendmail.SMTPHost = "Primary" > poSendmail.From = "me at orridge.co.uk" > poSendmail.FromDisplayName = "me" > poSendmail.Recipient = pStrEmailTo > poSendmail.ReplyToAddress = "me at orridge.co.uk" > poSendmail.Subject = "Personnel Available For Work" > poSendmail.Message = pStrEmailBody > poSendmail.Send > > Set poSendmail = Nothing > > ' >************************************************************************ >End Function > >I'm still getting > >User Defined Type Not Defined > >And points me to this line: > >Public poSendmail As vbSendMail.clsSendMail > >I have selected ActiveX Controls from the Tools menu in Access and >registered it that way, is that correct ? > >Paul Hartland