Subject Re: Sending email
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Thu, 11 Apr 2024 11:11:21 +0530
Newsgroups dbase.getting-started

Good Morning Agostinho,

It has been some time since I have used that program. The first time you
run the program you may need to run it as administrator to register the
dll. I would suggest that you place the dll in a directory where it will
be accessible for all and then run the program.
Regards
Akshat

> I'm trying to send an email using Marc VdB's test program.
> When entering all the information to set up and run it I get the following error.
> Error:  OLE Unable to create object.
>
> See Marc's program with my modification below.
>
> // Marc VdB's test program to get VdBMail working:
> set direc to c:\users\home_pc\desktop\dbasetutorial\dbase2021/vdbmail
> set procedure to mv_mail.cc
> email = new mv_mail()
>
> //oleautoclient not yet registered or unable to to create ...
> if email.errorcode = 371 or email.errorcode = 370
>     //? "Not registered"
>         success = email.register()
> else
>     //? "Already registered!"
>     success = true
> endif
>
> if not success
>         ? email.errortext // registration failed
>         return
> endif
>
> // set the SMTP : your account data comes here
> email.sethost("smtp.company-group.com")
> email.setport(25)
> email.setuser("my_name@company-group.com")
> email.setpw("MY_PASSWORD")
> email.setssl(true)
>
> // set the individual mail data
> email.setfrom("my_name@company-group.com")
> email.setsubject("testing")
> email.setbody("xxxx")
> email.sethtmlbody(true)
> // uses an array for multiple email addresses
> email.setaddress({"send_to@yahoo.com"})
> email.setattachment("any.txt")
>
> email.send()
>
> ? email.errorcode , email.errortext
>
>