Subject Re: Sending email
From AGOSTINHO <Agostinhoteixeira@yahoo.com>
Date Sat, 13 Apr 2024 02:27:52 -0400
Newsgroups dbase.getting-started

Dear Richard and Akshat thank you for your support.
Still cannot get this email issue running, what ever I change I get the same error:
Error:  OLE Unable to create object.

I don't need to use the samples from Marc VdB's test program I  just want to be able to send emails direct from within dbase plus, is there no easy way to do this?
Thanks

I got VDBMail working after quite a bit of experimentation:
THis is what works on my system:
        vdbPath =  .... // path to mv_mail.cc on your system
        success = email.register(vdbPath, true)
        email.setport(587)
        email.setSSL(false)
        email.setUser(my_name) // leave off the @company-group.com
Good luck

Akshat Kapoor Wrote:

> 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
> >
> >  
>