0

基本上,我创建了一个包含 To、From、Subject 和 Textbody 的表单,所有这些都被适当地命名。我需要知道的是我需要使用哪些代码来使用 Classic ASP 链接到本地​​端口,以测试我的代码并发送电子邮件,

我现在安装了 IIS 和其他一些小程序,但我无法理解它。

4

1 回答 1

3

中发送电子邮件通常是通过 CDO 完成的 - 例如使用 gmails SMTP 服务器(注意使用configuration/smtpserverportconfiguration/smtpusessl

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") = 465
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="info@thedomain.com" '#### Gmail Username (usually full email address)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password" '#### Gmail Password

ObjSendMail.Configuration.Fields.Update

ObjSendMail.To = ""
ObjSendMail.Subject = ""
ObjSendMail.From = ""

ObjSendMail.TextBody = "Hello World"

ObjSendMail.Send
Set ObjSendMail = Nothing 
于 2013-01-14T13:16:30.327 回答