无法使用经典 asp 从 godaddy smtp 发送电子邮件 - 发疯了
Cannot send email from godaddy smtp using classic asp - going mad
我真的在为一些非常基本的事情而苦苦挣扎,需要一些帮助,因为它不是来自 godaddy 的支持!
出于某种原因,下面的代码没有发送任何电子邮件。
代码似乎已被执行 属性 并且充满了很多调试信息但没有任何帮助!
Te "From" 电子邮件地址有效且没有问题!有任何想法吗?端口?
干杯,周杰伦
<%
Dim objNewMail
Set objNewMail = Server.CreateObject("CDO.Message")
objNewMail.From = "info@example.com"
objNewMail.To = "info@example.com"
objNewMail.Subject = "Interesting property sent by xxx"
objNewMail.TextBody = "Click the following link to see the property :" '& vbcr & vbcr & "http://www.maltawide.eu/default.asp?pid="
' GoDaddy SMTP Settings
'I had to remove the smpt settings as I dont have enough rep to post two links!
Response.Write ("Message sent successfully!")
%>
我不确定您的消息为何失败,但这是来自 GoDaddy 托管的有效邮件表单的代码。您需要做的就是构建表单页面以提交脚本中使用的表单域,或者更改脚本中的表单域名称以匹配您现有的表单,或者用字符串替换表单。表单输入和分配的变量值的示例包含在示例的“创建代码的消息部分”中。
<%
Dim strBody
Dim strToAddress
Dim strFromAddress
Dim strReplyAddress
Dim strBlindCC
' Create the message
strBody = Request.Form("Message")
strToAddress = Request.Form("ToAddress")
strFromAddress = Request.Form("FromAddress")
strReplyAddress = "NoReply@WebSite.com"
strBlindCC = "BlindCC@WebSite.com"
' Include the schemas
sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"
' Set the mail server configuration
Set objConfig=CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net"
objConfig.Fields.Update
' Send the message
Set objMail=CreateObject("CDO.Message")
Set objMail.Configuration=objConfig
objMail.From=strFromAddress
objMail.ReplyTo=strReplyAddress
objMail.To=strToAddress
objMail.BCC=strBlindCC
objMail.Subject=strSubject
objMail.HTMLBody = strBody
objMail.Send
%>
我真的在为一些非常基本的事情而苦苦挣扎,需要一些帮助,因为它不是来自 godaddy 的支持!
出于某种原因,下面的代码没有发送任何电子邮件。
代码似乎已被执行 属性 并且充满了很多调试信息但没有任何帮助!
Te "From" 电子邮件地址有效且没有问题!有任何想法吗?端口?
干杯,周杰伦
<%
Dim objNewMail
Set objNewMail = Server.CreateObject("CDO.Message")
objNewMail.From = "info@example.com"
objNewMail.To = "info@example.com"
objNewMail.Subject = "Interesting property sent by xxx"
objNewMail.TextBody = "Click the following link to see the property :" '& vbcr & vbcr & "http://www.maltawide.eu/default.asp?pid="
' GoDaddy SMTP Settings
'I had to remove the smpt settings as I dont have enough rep to post two links!
Response.Write ("Message sent successfully!")
%>
我不确定您的消息为何失败,但这是来自 GoDaddy 托管的有效邮件表单的代码。您需要做的就是构建表单页面以提交脚本中使用的表单域,或者更改脚本中的表单域名称以匹配您现有的表单,或者用字符串替换表单。表单输入和分配的变量值的示例包含在示例的“创建代码的消息部分”中。
<%
Dim strBody
Dim strToAddress
Dim strFromAddress
Dim strReplyAddress
Dim strBlindCC
' Create the message
strBody = Request.Form("Message")
strToAddress = Request.Form("ToAddress")
strFromAddress = Request.Form("FromAddress")
strReplyAddress = "NoReply@WebSite.com"
strBlindCC = "BlindCC@WebSite.com"
' Include the schemas
sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"
' Set the mail server configuration
Set objConfig=CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net"
objConfig.Fields.Update
' Send the message
Set objMail=CreateObject("CDO.Message")
Set objMail.Configuration=objConfig
objMail.From=strFromAddress
objMail.ReplyTo=strReplyAddress
objMail.To=strToAddress
objMail.BCC=strBlindCC
objMail.Subject=strSubject
objMail.HTMLBody = strBody
objMail.Send
%>