What is MailSender? To declare something like that, you either need to have
a reference set to an ActiveX component by that name, or else have a Class
with that name in your application.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)
"Ronny Sigo" <ronny.sigo@example.invalid> wrote in message
news:3fbf91e8$0$28306$ba620e4c@reader1.news.skynet .be...[color=blue]
> Hello all,
> I am trying to write a prog that autamatically sends emails ...
> Here is what I have done so far
> In the module section I have put this:
>
> Public Function SendEmail(email As String, subject As String, body As
> String, attach As String)
>
> Dim Mail As MailSender
> Set Mail = New MailSender
> Mail.Host = "relay.skynet.be"
> Mail.From = "my.emailaddress@myprovider.be"
> Mail.AddAddress (email)
> Mail.subject = subject
> Mail.body = body
> Mail.AddAttachment (attach)
>
> Mail.Send
>
> End Function
>
> Then in the program I assign values to the variables email,subject and[/color]
body[color=blue]
> Next I call the function ...
> x = SendEmail(email, subject, body + Chr(13) + "Test", "c:\log.txt")
> on running it I get this err-message:
> User defined type not defined
> How do I solve this , Can anybody help me with that ?
> Any suggestions very much appreciated
>
> Ronny Sigo
>
>[/color]