How do I send e-mails in my classic ASP v3 web applications?
Posted by Support, Last modified by Support on 23 July 2010 02:26 PM
To send e-mails using classic ASP on our Windows server, please use CDO as follows. CDONTS.NewMail only supports local smtp servers, so you can't set up a remote server to handle your e-mail from this object. And you're going to have to migrate away from CDONTS anyway, since it has been deprecated and no longer ships with Windows Server 2003 or Windows Server 2008. Please note the from e-mail address has to be a valid e-mail address on our e-mail servers. You can use CDO.Message as follows to send e-mails from our servers:

<!--  
    METADATA  
    TYPE="typelib"  
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library"  
-->  
<%  
    Set cdoConfig = Server.CreateObject("CDO.Configuration")  
 
    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = 2
        .Item(cdoSMTPServerPort) = 25
        .Item(cdoSMTPServer) = "10.1.19.76"  
        .Update  
    End With  
 
    Set cdoMessage = Server.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  
%>
(487 vote(s))
Helpful
Not helpful

Comments (0)