Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 14th, 2009, 11:01 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
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
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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 = "from@me.com" 
        .To = "to@me.com" 
        .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
Location: , , .
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
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
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.
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 03:51 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.