简体   繁体   English

IIS 7 + Windows Server 2008-使用CDO从Classic ASP发送电子邮件

[英]IIS 7 + Windows Server 2008 - Sending Emails from Classic ASP using CDO

On our existing platform we decided to upgrade our development server from Windows Server 2003 to 2008 some time ago. 在我们现有的平台上,我们决定将我们的开发服务器从Windows Server 2003升级到2008年。

The problem we are facing is that all asp scripts that used to send emails before when we had Windows Server 2003 worked. 我们面临的问题是,在使用Windows Server 2003之前,曾经用于发送电子邮件的所有asp脚本。 Now, they stopped working with no error on page or on the SMTP logs. 现在,他们停止了工作,页面或SMTP日志上都没有错误。

If I use telnet to send an email manually works fine. 如果我使用telnet手动发送电子邮件,效果很好。

But it's not working from our classic asp scripts. 但这在我们的经典ASP脚本中不起作用。

This is our ASP code 这是我们的ASP代码

Sub SendEmail(fromEmail, toEmail, ccEmail, bccEmail, subject, body, somefiles)
    Set m_Mailer = Server.CreateObject("CDO.Message")

    With m_Mailer.Configuration.Fields
      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
      .Item("http://schemas.microsoft.com/cdo/configuration/smptserver") = Request.ServerVariables("server_name")
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")=SMTP_SERVER_PICKUP_DIRECTORY
      .Update
    End With

    If m_CharacterSet <> "" Then
      m_Mailer.BodyPart.Charset = m_CharacterSet
    End If

    m_Mailer.To = toEmail
    m_Mailer.CC = ccEmail
    m_Mailer.BCC = bccEmail
    m_Mailer.From = fromEmail
    m_Mailer.ReplyTo = fromEmail
    m_Mailer.Subject = subject
    If m_UseHtmlFormat Then
      m_Mailer.HTMLBody   = FixText(body)
    Else
      m_Mailer.TextBody   = FixText(body)
    End If

    Dim i
    somefiles = Split(somefiles, vbTab)
    For i = 0 to UBound(somefiles)
        m_Mailer.AddAttachment(somefiles(i))
    Next
        m_Mailer.Send
End Sub

I've checked permissions on the mailroot folder and the IIS user has full control. 我已经检查了mailroot文件夹的权限,并且IIS用户具有完全控制权。 I've already set the relay to 127.0.0.1, and gave the IIS User access to the smtp as well. 我已经将中继设置为127.0.0.1,并为IIS用户授予了对smtp的访问权限。

When I use telnet I get everything on the log and receive the email correctly. 使用telnet时,我会在日志中获取所有内容并正确接收电子邮件。

But even when using this test script I don't get any email, they stay stuck on the pickup folder 但是,即使在使用此测试脚本时,我也没有收到任何电子邮件,但它们仍卡在提取文件夹中

Dim emailer 
Set emailer = New EmailHelper
emailer.SendEmail "test@test.com", "fede@shocklogic.com", "", "", "Test 1 2 3 from " & Request.ServerVariables("HTTP_HOST"), "Test...", ""

Set emailer = Nothing

Response.Write "DONE"

When I try to execute this test script I always get "DONE" on the page, but no email. 当我尝试执行此测试脚本时,页面上总是显示“ DONE”,但没有电子邮件。

SMTP is already installed and enabled. SMTP已安装并启用。

Any help would be great 任何帮助都会很棒

Found the solution! 找到了解决方案! (At least it works for me) (至少对我有用)

I removed this line 我删除了这条线

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")=SMTP_SERVER_PICKUP_DIRECTORY

And configured SMTP in IIS 7 console to use localhost instead of pickup directory and works perfect now! 并在IIS 7控制台中将SMTP配置为使用localhost而不是提取目录,并且现在可以正常使用!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在IIS6中的专用服务器(内存集)上使用cdo和classic asp发送电子邮件? - sending email using cdo & classic asp on dedicated server (memset) in IIS6? 在iis 7中配置smtp,用于从经典的asp应用程序发送电子邮件 - configuring smtp in iis 7 for sending emails from classic asp application Windows Server 2008,IIS 7上的经典ASP .CopyFile“权限被拒绝”错误 - Classic ASP .CopyFile “Permission Denied” error on Windows Server 2008, IIS 7 使用SQL Native Client无法从Classic ASP连接到SQL Server 2008 R2(Windows 7 - IIS7) - Cannot connect from Classic ASP to SQL Server 2008 R2 using SQL Native Client (Windows 7 - IIS7) IIS7 Windows 2008服务器上的经典ASP模拟问题 - Classic ASP Impersonation problem on IIS7 Windows 2008 server 在x64 Windows Server 2008和IIS7上使用COM +的经典ASP - Classic ASP using COM+ on x64 Windows Server 2008 and IIS7 使用COM + .Net Interop 64位Windows Server 2008 IIS 7 Server.CreateObject的经典ASP失败 - Classic ASP using COM+ .Net Interop 64 Bit Windows Server 2008 IIS 7 Server.CreateObject Fails 从Windows Server 2008发出请求时经典ASP中的错误 - Error in classic asp while making request from windows server 2008 经典ASP会话在IIS 7 Windows Server 2008 R2 x64中不起作用 - Classic ASP Session not working in IIS 7 Windows Server 2008 R2 x64 在Windows Server 2008 R2的IIS 7中找不到(404)经典ASP起始页 - Classic ASP start page not found (404) in IIS 7 on Windows Server 2008 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM