Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Send form data using CDO

Reply
Thread Tools

Send form data using CDO

 
 
Kenny
Guest
Posts: n/a
 
      11-07-2005
I'm trying to retrieve the data off a form (survey.htm) and email the results
back to me using CDO and ASP (survey.asp). I'm confused as to how to
retrieve the form data from survey.htm and send it using survey.asp. Below is
a sample ASP script that I found on ASPFAQ.com and it works fine, but now how
do I grab the info from a form and incorporate it into the emal. Thanks.
Appreciate any help or guidance.

Kenny

<%
sch = "http://schemas.microsoft.com/cdo/configuration/"

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "servername"
.update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = ""
.To = ""
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

 
Reply With Quote
 
 
 
 
Drew
Guest
Posts: n/a
 
      11-07-2005
Depending on how you want to do it, if you want it to look nice, just make
your .TextBody something like this

..TextBody = "Name: " & Request.Form("Name") & "<br>Address: " &
Request.Form("Address")" 'and so on and so on

If you want it just thrown in there all messy looking just do this,

..TextBody = "Form Data is <br>" & Request.Form()

If your form method is set to GET, change Request.Form to
Request.Querystring.

HTH,
Drew



"Kenny" <> wrote in message
news:5D0F2E78-45FB-45F2-996D-...
> I'm trying to retrieve the data off a form (survey.htm) and email the
> results
> back to me using CDO and ASP (survey.asp). I'm confused as to how to
> retrieve the form data from survey.htm and send it using survey.asp. Below
> is
> a sample ASP script that I found on ASPFAQ.com and it works fine, but now
> how
> do I grab the info from a form and incorporate it into the emal. Thanks.
> Appreciate any help or guidance.
>
> Kenny
>
> <%
> sch = "http://schemas.microsoft.com/cdo/configuration/"
>
> Set cdoConfig = CreateObject("CDO.Configuration")
>
> With cdoConfig.Fields
> .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
> .Item(sch & "smtpserver") = "servername"
> .update
> End With
>
> Set cdoMessage = CreateObject("CDO.Message")
>
> With cdoMessage
> Set .Configuration = cdoConfig
> .From = ""
> .To = ""
> .Subject = "Sample CDO Message"
> .TextBody = "This is a test for CDO.message"
> .Send
> End With
>
> Set cdoMessage = Nothing
> Set cdoConfig = Nothing
> %>
>



 
Reply With Quote
 
 
 
 
Kenny
Guest
Posts: n/a
 
      11-13-2005
Thanks, I really appreciate your help. I was able to use "& request.form() &"
to get the information but just like you said, it looked all mumble jumbled
together. I tried inserting html coding; however, using it in TextBody = " "
only repeats the html coding in the message, so when I type <br>, that's what
appears in the email generated the code <br> instead of the line break. How
do I import the form and use html?

Kenny

"Drew" wrote:

> Depending on how you want to do it, if you want it to look nice, just make
> your .TextBody something like this
>
> ..TextBody = "Name: " & Request.Form("Name") & "<br>Address: " &
> Request.Form("Address")" 'and so on and so on
>
> If you want it just thrown in there all messy looking just do this,
>
> ..TextBody = "Form Data is <br>" & Request.Form()
>
> If your form method is set to GET, change Request.Form to
> Request.Querystring.
>
> HTH,
> Drew
>
>
>
> "Kenny" <> wrote in message
> news:5D0F2E78-45FB-45F2-996D-...
> > I'm trying to retrieve the data off a form (survey.htm) and email the
> > results
> > back to me using CDO and ASP (survey.asp). I'm confused as to how to
> > retrieve the form data from survey.htm and send it using survey.asp. Below
> > is
> > a sample ASP script that I found on ASPFAQ.com and it works fine, but now
> > how
> > do I grab the info from a form and incorporate it into the emal. Thanks.
> > Appreciate any help or guidance.
> >
> > Kenny
> >
> > <%
> > sch = "http://schemas.microsoft.com/cdo/configuration/"
> >
> > Set cdoConfig = CreateObject("CDO.Configuration")
> >
> > With cdoConfig.Fields
> > .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
> > .Item(sch & "smtpserver") = "servername"
> > .update
> > End With
> >
> > Set cdoMessage = CreateObject("CDO.Message")
> >
> > With cdoMessage
> > Set .Configuration = cdoConfig
> > .From = ""
> > .To = ""
> > .Subject = "Sample CDO Message"
> > .TextBody = "This is a test for CDO.message"
> > .Send
> > End With
> >
> > Set cdoMessage = Nothing
> > Set cdoConfig = Nothing
> > %>
> >

>
>
>

 
Reply With Quote
 
PJones
Guest
Posts: n/a
 
      11-27-2005
http://www.powerasp.com/content/new/...ail_cdosys.asp

http://www.powerasp.com/content/new/...ing_cdosys.asp



"Kenny" <> wrote in message
news:2F1BD933-6643-486E-9AA0-...
> Thanks, I really appreciate your help. I was able to use "& request.form()
> &"
> to get the information but just like you said, it looked all mumble
> jumbled
> together. I tried inserting html coding; however, using it in TextBody =
> " "
> only repeats the html coding in the message, so when I type <br>, that's
> what
> appears in the email generated the code <br> instead of the line break.
> How
> do I import the form and use html?
>
> Kenny
>
> "Drew" wrote:
>
>> Depending on how you want to do it, if you want it to look nice, just
>> make
>> your .TextBody something like this
>>
>> ..TextBody = "Name: " & Request.Form("Name") & "<br>Address: " &
>> Request.Form("Address")" 'and so on and so on
>>
>> If you want it just thrown in there all messy looking just do this,
>>
>> ..TextBody = "Form Data is <br>" & Request.Form()
>>
>> If your form method is set to GET, change Request.Form to
>> Request.Querystring.
>>
>> HTH,
>> Drew
>>
>>
>>
>> "Kenny" <> wrote in message
>> news:5D0F2E78-45FB-45F2-996D-...
>> > I'm trying to retrieve the data off a form (survey.htm) and email the
>> > results
>> > back to me using CDO and ASP (survey.asp). I'm confused as to how to
>> > retrieve the form data from survey.htm and send it using survey.asp.
>> > Below
>> > is
>> > a sample ASP script that I found on ASPFAQ.com and it works fine, but
>> > now
>> > how
>> > do I grab the info from a form and incorporate it into the emal.
>> > Thanks.
>> > Appreciate any help or guidance.
>> >
>> > Kenny
>> >
>> > <%
>> > sch = "http://schemas.microsoft.com/cdo/configuration/"
>> >
>> > Set cdoConfig = CreateObject("CDO.Configuration")
>> >
>> > With cdoConfig.Fields
>> > .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
>> > .Item(sch & "smtpserver") = "servername"
>> > .update
>> > End With
>> >
>> > Set cdoMessage = CreateObject("CDO.Message")
>> >
>> > With cdoMessage
>> > Set .Configuration = cdoConfig
>> > .From = ""
>> > .To = ""
>> > .Subject = "Sample CDO Message"
>> > .TextBody = "This is a test for CDO.message"
>> > .Send
>> > End With
>> >
>> > Set cdoMessage = Nothing
>> > Set cdoConfig = Nothing
>> > %>
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
send cdo e-mail with database data joeyjoejnr ASP General 2 08-16-2007 10:18 PM
what is ("http://schemas.microsoft.com/cdo/configuration/sendusing") doing in CDO uofs76@yahoo.com ASP General 0 02-07-2007 01:09 PM
Send Outlook Task Using CDO on Windows 2000 Tim M ASP General 0 12-01-2005 05:51 AM
Permissions Issue with ASP.NET using CDO for Send Mail Function Lance Safford ASP .Net 0 04-21-2004 07:13 PM
CDO for Windows 2000 vs CDO for Exchange 2000 ASP .Net 2 07-11-2003 12:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57