티스토리 뷰

FIRST, I had to address the tighter security of IIS7 by adding the CDO Library metadata and Configuration like below (보기: http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html)

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
       .Item(cdoSendUsingMethod) = cdoSendUsingPort
       .Item(cdoSMTPServer) = "<enter_mail.server_here>"   '  .....I use "localhost"
'        --- To put in the pickup box if you don't have an SMTP service, use this instead:
'       .Item(cdoSendUsingMethod) = cdoSendUsingPickup
'       .Item(cdoSMTPServerPickupDirectory) = "c:\Inetpub\mailroot\Pickup"   ' make sure directory allows writing
       .Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
       Set .Configuration = cdoConfig
      .From = from@me.com
      .To = to@me.com
      .Subject = "Sample CDO Message"
      .TextBody = "This is a test for CDO.message"
      .Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

NEXT, I downloaded a free, simple to use SMTP server from:  http://softstack.com/freesmtp.html
(See http://weblogs.asp.net/steveschofield/archive/2006/12/19/iis7-post-23-vista-and-smtp-server-where-is-it.aspx)

Now all works great!


Or you can use the workaround of copying cdonts.dll from a Windows 2000 machine and regsvr32'ing it on the XP machine. I have not tested this method, so try it at your own risk. If it works, it may — at least in the short term — be the better solution. But you should plan to migrate your code eventually, because hosts running Windows 2003 are unlikely to be willing to register obsolete DLLs.


[출처] http://forums.iis.net/t/1106115.aspx

댓글