Godaddy支持在线发邮件的代码
分类:电脑知识 发表于:2010-12-30 19:56:56 评论(2)
<%
email=request("email")
content=request("content")
Function Send_Email(content)
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 = email
objMail.To = "收信邮箱"
objMail.BodyPart.Charset = "utf-8"
objMail.Subject = "主题"
objMail.TextBody = content
objMail.Send
Set objMail = Nothing
End Function
%>
调用:
<%Call Send_EMail(content)%>
备注:
1.“email”为发信人所填的邮箱,收到邮件后直接成为发信箱。
2.不管是发信箱,收信箱,还是内容,全都不得出现QQ字样,GODADDY全面屏蔽QQ,写了就会出错。