我有兴趣通过 ASP 页面发送电子邮件。我在互联网上照顾它,我发现了一些东西。
<%
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "smtp.gmail.com"
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = Request.Form("From")
.To = Request.Form("To")
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
但它没有向我发送电子邮件,它说“流量无法连接到服务器”我应该在代码中更改什么?
非常感谢。