今天特意研究了一下godaddy空间的在线发送邮件组件,试了几个代码,最后这个CDO.Message组件代码可用;
我的godaddy空间是150G的那种,windows系统,IIS7的。
<%
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
' Create and send the mail
Set objMail=CreateObject("CDO.Message")
' Use the config object created above
Set objMail.Configuration=objConfig
objMail.From="123@123.com "
objMail.To="321@321.com "
objMail.BodyPart.Charset = "utf-8"
objMail.Subject="邮件标题"
objMail.TextBody="邮件内容"
objMail.Send
Set objMail = Nothing
%>
1,发现很有意思的地方,就是objMail.From=" 123@123.com " 发件人可以随意填写,都能发送成功,根本不需要什么godaddy的企业邮局,这一点让我很惊讶。
2,objMail.BodyPart.Charset = "utf-8 "
增加了编码定义功能,发送邮件不再乱码
3,邮件到达的速度时快时慢,有时候可以达到秒速,有时候可能要好几分钟