使用经典 ASP 发送邮件? [英] Sending mail using classic ASP?

查看:17
本文介绍了使用经典 ASP 发送邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用经典 ASP 发送邮件,但我的页面包含一些错误,这就是为什么当上传显示错误的页面:

I am trying to send mail using classic ASP, but my page contain some error that's why when upload the page it shows the error that :

500 内部服务器错误

500 Internal Server Error

这是我正在使用的代码;

This is the code i am using;

<%
Dim smtpserver,youremail,yourpassword,ContactUs_Name,ContactUs_Tel,ContactUs_Email
Dim ContactUs_Subject,ContactUs_Body,Action,IsError

smtpserver = "smtp.gmail.com"
youremail = "xxxxx.yyyyyy@gmail.com"
yourpassword = "password" 

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message") 
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1 'Use SSL for the connection
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "aaaaa.bbbbbb@gmail.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
ObjSendMail.Configuration.Fields.Update
ObjSendMail.To = "aaaaa.bbbbbb@gmail.com"
ObjSendMail.CC = "cccccc.dddddd@sunarctechnologies.com"
ObjSendMail.Subject = "Subject"
ObjSendMail.From = "xxxxx.yyyyyy@gmail.com"
ObjSendMail.HTMLBody = "<p>hello</p>"
ObjSendMail.Send
Set ObjSendMail = Nothing 
%>

我对经典的 asp 没有任何概念,这只是从其他来源复制粘贴代码.

I don't have any idea of classic asp this is just copy paste code from some other source.

推荐答案

您的代码看起来正确,但我会检查 gmail 是否仅接受端口 465 上的 SSL 连接.我相信端口 567 用于 TLS 连接.或者,只需尝试端口 25.

Your code looks correct but I'd check wheter gmail only accepts SSL connections on port 465. I believe port 567 is for TLS connections. Alternatively just try port 25.

这个问题和你的类似.

您还确实需要能够查看您的应用程序报告的详细错误消息.

You also really need to be able to see the detailed error messages your application is reporting.

这篇关于使用经典 ASP 发送邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆