SMTP configuration SendUsing configuration value is invalid with ASP-Classic

前端 未结 2 1466
野的像风
野的像风 2020-12-17 21:45

I\'m trying to get an email sent using ASP classic, and am having trouble with SMTP configuration.

The error:

CDO.Message.1 error \'80040220\'

相关标签:
2条回答
  • 2020-12-17 22:16

    As the SMTP service is on the localhost it makes more sense to send to pickup directory using SendUsingPickup (1). This will be more efficient than sending over network to port 25.

    objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Pickup"
    objMsg.Configuration.Fields.Update 
    
    0 讨论(0)
  • 2020-12-17 22:25

    If you are specifying an smptserver, be sure to set your 'sendusing' field to 2 (or cdoSendUsingPort) as well:

    objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objMsg.Configuration.Fields.Update 
    
    0 讨论(0)
提交回复
热议问题