473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Send form data using CDO

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 = "me@you.com"
.To = "me@you.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Nov 7 '05 #1
3 3005
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" <Ke***@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
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 = "me@you.com"
.To = "me@you.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Nov 7 '05 #2
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" <Ke***@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
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 = "me@you.com"
.To = "me@you.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>


Nov 22 '05 #3
http://www.powerasp.com/content/new/...ail_cdosys.asp

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

"Kenny" <Ke***@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
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" <Ke***@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
> 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 = "me@you.com"
> .To = "me@you.com"
> .Subject = "Sample CDO Message"
> .TextBody = "This is a test for CDO.message"
> .Send
> End With
>
> Set cdoMessage = Nothing
> Set cdoConfig = Nothing
> %>
>


Nov 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
1
by: Raichu | last post by:
Hi All, I'm new to VC++.net and I searched through the forums and couldn't find anything related to this. I'm trying to send a flat file from a VC++.net program to a PHP file residing on a...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
10
by: Aj Blosser | last post by:
Hey guys, I have a question for you, I have a setup where I'm sending files through the POST to a php web page, I read the file contents, put that file contents as text into the POST string, and...
0
southoz
by: southoz | last post by:
Good ay all , I'm fairly new to access(a little over 5 weeks now). Since I'v started I have picked up a lot of useful information from forums such as this and in doing so will share that information...
5
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
2
by: ajaxcoder | last post by:
Hi In my project i had a login form and i am trying to send the username and password to the server for authentication using xmlHttpRequest. Hence i am using POST request but i am unable to send...
0
by: icyfenix | last post by:
I'm a developer for my company and my job is to make things move faster and reduce overhead/labor dollars using software. We are in an all-Microsoft environment. The problem I am having is this:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.