Classic ASP send mail with CDOSYS in VBScript

Classic ASP send mail with CDOSYS in VBScript Sample Code

Note: your_domain_name.com is your actual domain name. name is your actual email address name. your_email_password is your actual email password.
 
<!--
    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) = "mail.your_domain_name.com"  
        .Item(cdoSMTPAuthenticate) = 1
        .Item(cdoSendUsername) = "name@your_domain_name.com"  
        .Item(cdoSendPassword) = "your_email_password"
        .Update  
    End With
 
    Set cdoMessage = CreateObject("CDO.Message")  
 
    With cdoMessage
        Set .Configuration = cdoConfig
        .From = "name@your_domain_name.com"
        .To = "name@your_domain_name.com"
        .Subject = "CDOSYS Message"
        .TextBody = "CDOSYS Message sent with SMTP Authentication"
        .Send
    End With
 
    Set cdoMessage = Nothing  
    Set cdoConfig = Nothing

Response.write "Message Sent"
%>

Add Feedback