Wrox Programmer Forums
|
User Groups - Other Developer User Groups Post your announcements about user groups for developer audiences other than INETA and LUGs
Welcome to the p2p.wrox.com Forums.

You are currently viewing the User Groups - Other Developer User Groups section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 14th, 2009, 11:01 PM
Authorized User
 
Join Date: Jan 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to creative_eye
Default ASP - sending form with CDOSYS

Hi,

I'm a newbie and I'm creating this page first time. I've a form with 15 fields and I want to send the information in my email using ASP CDOSYS. I found solutions online but those are limited to fields: To, From, Subject and Message.
As I mentioned I've 15 fields in my form, how could I send these fields values in my email.
Any help would be greatly appreciated. Thanks in advance.
  #2 (permalink)  
Old October 15th, 2009, 02:41 AM
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.
  #3 (permalink)  
Old October 15th, 2009, 04:15 AM
Authorized User
 
Join Date: Jan 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to creative_eye
Default

I've tried this code, but it says "The page cannot be displayed"
I've checked in the form action, and it was the right file name.
  #4 (permalink)  
Old October 15th, 2009, 04:56 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following example:
http://www.codeproject.com/KB/asp/sendmail.aspx
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Mail Using CDOSYS in ASP artarasan Classic ASP Basics 1 May 12th, 2008 06:11 PM
Form in ASP using CDOSYS webbman75 Classic ASP Basics 2 March 28th, 2007 08:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.