【问题标题】:Using amazon SES to send email in classic asp使用 amazon SES 在经典 asp 中发送电子邮件
【发布时间】:2012-05-19 04:43:54
【问题描述】:

我正在尝试使用 Amazon SES 发送一封测试电子邮件,但没有成功:

Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

Const cdoSendUsingPort = 2

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "email-smtp.us-east-1.amazonaws.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic 
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "ABCDE"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "12345"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

With iMsg
Set .Configuration = iConf
.To = "bar@foo.com"
.From = "foo@bar.com"
.Subject = "test"
.TextBody = "body"
.Send
End With

response.write("sent")

日志信息似乎表明身份验证有问题。不幸的是,我并不精通,也不明白我可能做错了什么。

Response: 250-email-smtp.amazonaws.com
Response: 250-8BITMIME
Response: 250-SIZE 10485760
Response: 250-STARTTLS
Response: 250-AUTH PLAIN LOGIN
Response: 250 Ok

Command: AUTH LOGIN

Response: 530 Must issue a STARTTLS command first

Command: MAIL FROM: [address in verified senders list]

Response: 530 Authentication required

Command: Quit

【问题讨论】:

  • 您是如何从 VBScript/CDO 获得日志信息的?
  • @ulty4life 我认为是使用 Wireshark

标签: asp-classic amazon-web-services amazon-ses cdo.message


【解决方案1】:

解决方法如下:

响应:530 必须先发出 STARTTLS 命令

您需要在进行身份验证之前启用安全连接。您已经通过配置启用 SSL:

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True

将其更改为:

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1

(注意从True1 的变化)

【讨论】:

  • 我试过了,得到了这个:Microsoft VBScript runtime error '800a01b6' Object doesn't support this property or method: 'EnableSsl'
  • 好的,那就不要添加.EnableSsl = True 选项。我想我将 .NET 与 ASP Classic 混淆了。但是对于 smtpusessl 配置选项,请将 True 更改为 1
  • 似乎奏效了。不敢相信事情就这样发展了。干杯!
  • 有时就这么简单。太好了,对你有用!
猜你喜欢
  • 2012-12-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-22
  • 2016-08-22
相关资源
最近更新 更多