简体   繁体   English

cdonts和中继服务器?

[英]cdonts and relay server?

I use CDONTS when I need to send up send email form on websites. 当我需要在网站上发送发送电子邮件表格时,我使用CDONTS。 Recently changed my hosting company to godaddy. 最近我的托管公司改为godaddy。 I realized my send email form gives "permission denied" error. 我意识到我的发送电子邮件表单给出了“拒绝权限”错误。 I called GoDaddy support. 我打电话给GoDaddy支持。 They told me I should use relay server "relay-hosting.secureserver.net" in my codes. 他们告诉我应该在我的代码中使用中继服务器“relay-hosting.secureserver.net”。 I thought relay server used only with CDO. 我以为中继服务器只用于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

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 . 网络搜索“cdonts relay”产生了这个与GoDaddy.com直接相关的例子 - 基于我读过的所有内容,这只适用于CDO.Message而不是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.Update objMail.Send set ojbMail = nothing 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM