SMTP配置SendUsing配置值与ASP-经典无效 [英] SMTP configuration SendUsing configuration value is invalid with ASP-Classic

查看:1975
本文介绍了SMTP配置SendUsing配置值与ASP-经典无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让使用ASP经典,发送电子邮件,时遇到的SMTP配置的麻烦。

错误:


  

CDO.Message.1错误'80040220'了SendUsing配置值
  无效的。


在code(用于电子邮件本身):

 设置objMsg =的Server.CreateObject(CDO.Message)
objMsg.From =name@name.com
objMsg.To =themetatron@gmail.com
objMsg.Subject =采购盟友更新
objMsg.TextBody = strBody

在code我试图与配置(PT 1):

  SCH =htt​​p://schemas.microsoft.com/cdo/configuration/
设置cdoConfig =的CreateObject(CDO.Configuration)
    随着cdoConfig.Fields
        .Item(SCH&安培;SMTPSERVER)=127.0.0.1
        .update
    结束与

这没有工作,所以我尝试:

<$p$p><$c$c>objMsg.Configuration.Fields.Item(\"http://schemas.microsoft.com/cdo/configuration/smtpserver\") =本地主机
objMsg.Configuration.Fields.Item(http://schemas.microsoft.com/cdo/configuration/smtpserverport)= 25
objMsg.Configuration.Fields.Update

这也没有工作。

(是的,我没有表现出来,但最后有一个呼叫 objMsg.Send

据我所知道的,当地盒SMTP服务正在运行,并准备尽自己的职责。

谁能帮助?


解决方案

如果您在指定smptserver,一定要设置的sendusing 字段设置为2(或cdoSendUsingPort),以及:

<$p$p><$c$c>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

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' The "SendUsing" configuration value is invalid.

The Code(for the email itself):

Set objMsg = Server.CreateObject("CDO.Message")  
objMsg.From     = "name@name.com"  
objMsg.To       = "themetatron@gmail.com"  
objMsg.Subject  = "Procurement Ally Update"  
objMsg.TextBody = strBody 

The Code I tried to configure with (pt 1):

sch = "http://schemas.microsoft.com/cdo/configuration/"  
Set cdoConfig = CreateObject("CDO.Configuration")   
    With cdoConfig.Fields   
        .Item(sch & "smtpserver") = "127.0.0.1"   
        .update   
    End With   

That didn't work, so I tried:

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 

That also didn't work.

(Yes, I didn't show it, but at the end there's a call to objMsg.Send)

As far as I can tell, the local boxes SMTP service is running and ready to do its duty.

Can anyone help?

解决方案

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

这篇关于SMTP配置SendUsing配置值与ASP-经典无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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