Sending email with asp & cdosys

I found this script to send emails from our server, which I later intend to use to send confirmation emails to people who have filled out a form from our site.

It works fine, if the case is this:

ObjSendMail.To = "someoesEmail@ourDomain.com"
ObjSendMail.Subject = “this is the subject”
ObjSendMail.From = "myEmail@ourDomain.com"

But won’t send like this:

ObjSendMail.To = "someonesEmail@theirDomain.com"
ObjSendMail.Subject = “this is the subject”
ObjSendMail.From = "myEmail@ourDomain.com"

I’m new to all of this, so if anyone can shine some light to this, would be great.
Thanks!

The complete script is below


<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message") 
     
'This section provides the configuration information for the remote SMTP server.
     
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.ourdomain.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
     

     
ObjSendMail.Configuration.Fields.Update
     

ObjSendMail.To = "someonesEmail@theirDomain.com"
 ObjSendMail.Subject = "this is the subject"
 ObjSendMail.From = "myEmail@ourDomain.com"
     
ObjSendMail.HTMLBody = "this is the body"
     
ObjSendMail.Send
     
Set ObjSendMail = Nothing 


Response.Write "your email has been sent"
%>