View Single Post
  #2 (permalink)  
Old October 15th, 2009, 02:41 AM
om_prakash om_prakash is offline
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

When form is submitted, you can write the following code.
Code:
<% 
    sch = "http://schemas.microsoft.com/cdo/configuration/" 
 
    Set cdoConfig = CreateObject("CDO.Configuration") 
 
    With cdoConfig.Fields 
        .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
        .Item(sch & "smtpserver") = "<enter_mail.server_here>" 
        .update 
    End With 
 
    Set cdoMessage = CreateObject("CDO.Message") 
    Dim txtBody
 
    With cdoMessage 
        Set .Configuration = cdoConfig 
        .From = "[email protected]" 
        .To = "[email protected]" 
        .Subject = "Sample CDO Message" 
 
         'You can add all the form fields you want..
         txtBody = "Field1 : " & Request.form("Field1")
         txtBody =  txtBody & "Field2 : " & Request.form("Field2")
 
        .TextBody = "This is a test for CDO.message" & txtBody 
        .Send 
    End With 
 
    Set cdoMessage = Nothing 
    Set cdoConfig = Nothing 
%>
http://classicasp.aspfaq.com/email/h...-with-cdo.html
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.