Subject Sending email
From AGOSTINHO <Agostinhoteixeira@yahoo.com>
Date Wed, 10 Apr 2024 23:21:00 -0400
Newsgroups dbase.getting-started

Dear group,
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