tags:

views:

230

answers:

1

I use CDONTS when I need to send up send email form on websites. Recently changed my hosting company to godaddy. I realized my send email form gives "permission denied" error. I called GoDaddy support. They told me I should use relay server "relay-hosting.secureserver.net" in my codes. I thought relay server used only with CDO.

How can I include it to my codes? My codes

Set objEmail = Server.CreateObject("CDONTS.NewMail")
objEmail.To   = MailTo
objEmail.Cc   = MailCc
objEmail.From   = MailFrom
objEmail.Subject  = MailSubject
objEmail.Body   = MailBody
objEmail.Send
Set objEmail = nothing
+1  A: 

A web search for "cdonts relay" yielded this example which relates directly to your issue with GoDaddy.com - Based on everything I've read, this only works with CDO.Message instead of CDONTS.NewMail.


UPDATE: Here's the modified code

Set objMail = Server.CreateObject("CDO.Message")
objMail.From = MailFrom
objMail.To= MailTo
objMail.Subject = MailSubject
objMail.TextBody = MailBody
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net"
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMail.Configuration.Fields.Item  

objMail.Configuration.Fields.Update
objMail.Send
set ojbMail = nothing
Jose Basilio
I dont have an email account but I dont think I need to provide user name and password. At least that's what they told me over the phone.
According to GoDaddy, you don't need the username/password. Please see the updated code removing the authentication related lines.
Jose Basilio