Current location: Hot Scripts Forums » Programming Languages » ASP » CDONTS not working quite right...


CDONTS not working quite right...

Reply
  #1 (permalink)  
Old 06-10-04, 06:25 AM
JessSchmidt JessSchmidt is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
CDONTS not working quite right...

With regard to my previous post "CDONTS???", the problem has, apparently not been solved. I've been able to get an email but only the last field appears IN the email. Here is the code for the page. I don't understand what is wrong...I hope someone can help me! When I put this: objCDONTS.Body = objCDONTS.body & request.form("fieldname")
I get an error message that says Body is not supported. Now I'm completely confused.

<%
name = request.form("FirstName")
email = request.form("Email")

If name="" or email="" Then
url = "contact.asp?reqd=* indicates required field&name=" & name & "&email=" & email
If name="" Then
url = url & "&mFirstName=*"
End if

If email="" Then
url = url & "&mEmail=*"
End if

response.redirect url & "&foobar=foobar#form"
response.end
End if

Dim objCDONTS ' Email object
Dim strFromName ' From persons' real name
Dim strFromEmail, strToEmail ' Email addresses
Dim strSubject, strBody ' Message
Dim misccompo

strSubject = "MAILING LIST SIGN UP"
strFromName = Trim(Request.Form("FirstName"))
strFromEmail = Trim(Request.Form("Email"))
strToEmail = "jesstest@mqinnovations.com"
strBody = Trim(Request.Form("FirstName"))
strBody = Trim(Request.Form("LastName"))
strBody = Trim(Request.Form("Address"))
strBody = Trim(Request.Form("City"))
strBody = Trim(Request.Form("State"))
strBody = Trim(Request.Form("Zip"))
strBody = Trim(Request.Form("WrkPhone"))
strBody = Trim(Request.Form("Email"))
strBody = Trim(Request.Form("OwnMachineYes"))
strBody = Trim(Request.Form("OwnMachineNo"))
strBody = Trim(Request.Form("OwnLength"))

Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody & request.form("FirstName")
objCDONTS.Body = strBody & request.form("LastName")
objCDONTS.Body = strBody & request.form("Address")
objCDONTS.Body = strBody & request.form("City")
objCDONTS.Body = strBody & request.form("State")
objCDONTS.Body = strBody & request.form("Zip")
objCDONTS.Body = strBody & request.form("WrkPhone")
objCDONTS.Body = strBody & request.form("Email")
objCDONTS.Body = strBody & request.form("OwnMachineYes")
objCDONTS.Body = strBody & request.form("OwnMachineNo")
objCDONTS.Body = strBody & request.form("OwnLength")

objCDONTS.Send
Set objCDONTS = Nothing

response.redirect "thanks.asp"
response.end
%>

Last edited by JessSchmidt; 06-10-04 at 06:27 AM.
Reply With Quote
  #2 (permalink)  
Old 06-11-04, 02:50 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

There is not need to get coufused...its very simple..

just use your code this way...
---------------------------
strBody = request.form("FirstName")
strBody = strBody & request.form("LastName")
strBody = strBody & request.form("Address")
strBody = strBody & request.form("City")
strBody = strBody & request.form("State")
strBody = strBody & request.form("Zip")
strBody = strBody & request.form("WrkPhone")
strBody = strBody & request.form("Email")
strBody = strBody & request.form("OwnMachineYes")
strBody = strBody & request.form("OwnMachineNo")
strBody = strBody & request.form("OwnLength")

objCDONTS.Body = strBody
Reply With Quote
  #3 (permalink)  
Old 06-13-04, 10:08 AM
JessSchmidt JessSchmidt is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
OMG! IT WORKED!!

One last thing, I get the results but they are all running together on one line that wraps. How do I separate and make the results look like this with a label:

First Name: Jessica - ("Jessica" is the result)
Last Name: Schmidt
etc...

Here is the code for the page:

<%
name = request.form("FirstName")
email = request.form("Email")

If name="" or email="" Then
url = "contact.asp?reqd=* indicates required field&name=" & name & "&email=" & email
If name="" Then
url = url & "&mFirstName=*"
End if

If email="" Then
url = url & "&mEmail=*"
End if

response.redirect url & "&foobar=foobar#form"
response.end
End if

Dim objCDONTS ' Email object
Dim strFromName ' From persons' real name
Dim strFromEmail, strToEmail ' Email addresses
Dim strSubject, strBody ' Message
Dim misccompo

strSubject = "MAILING LIST SIGN UP"
strFromName = Trim(Request.Form("FirstName"))
strFromEmail = Trim(Request.Form("Email"))
strToEmail = "jesstest@mqinnovations.com"
strBody = strBody & request.form("FirstName")
strBody = strBody & request.form("LastName")
strBody = strBody & request.form("Address")
strBody = strBody & request.form("City")
strBody = strBody & request.form("State")
strBody = strBody & request.form("Zip")
strBody = strBody & request.form("WrkPhone")
strBody = strBody & request.form("Email")
strBody = strBody & request.form("OwnMachineYes")
strBody = strBody & request.form("OwnMachineNo")
strBody = strBody & request.form("OwnLength")

Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody

objCDONTS.Send
Set objCDONTS = Nothing

response.redirect "thanks.asp"
response.end
%>

I am indebted and I thank you A MILLION TIMES for your help and saving my sanity!!!

Jess
Reply With Quote
  #4 (permalink)  
Old 06-14-04, 05:43 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Hi,

you can put newline in your string by adding "<br>" wherever you want...

example....
strBody = strBody & " FirstName : " & request.form("FirstName") & "<br>"
strBody = strBody & "Last Name : " & request.form("LastName") & "<br>"
.....keep going...
and you are done....
Reply With Quote
  #5 (permalink)  
Old 06-14-04, 11:58 AM
JessSchmidt JessSchmidt is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you...

I will try that and see how it works. I can't thank you enough. May God bless you abundantly!
Reply With Quote
  #6 (permalink)  
Old 06-16-04, 04:00 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Good Wishes...

always welcomed...
Reply With Quote
  #7 (permalink)  
Old 07-21-04, 07:28 AM
maximus2004 maximus2004 is offline
New Member
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cdonts Will Not Work For Me


Hello, I noticed your threads and thought if someone could look at my code and see maybe what I am doing wrong.
************************************************** *
<form method=Post action=get.asp>
valley secretary<br>
<input type="text" name="t1" size="20"><p>
<input type=submit value=Submit></form>
************************************************** *
<%
Dim t1name,t1
t1name = "valley secretary"
t1 = Request.Form("t1")
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.To = "kklimarchuk@supremecouncil.org"
ObjMail.From = "kklimarchuk@supremecouncil.org"
ObjMail.Subject = "Form Submission"
ObjMail.Body = t1name & vbcrlf&_t1
ObjMail.Send
Set ObjMail = Nothing
Response.Write"Thank You"
%>

Here are the two pages html and calling the asp. As you can see I am new to this. I also had our Network Admin make sure CDONTS was installed correctly on IIS. Any help would be awesome. I have been trying to create an email form for months now......
Reply With Quote
  #8 (permalink)  
Old 07-21-04, 11:33 AM
stompalot stompalot is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Try this....

<%
Dim t1name,t1
t1name = "valley secretary"
t1 = Request.Form("t1")
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
ObjMail.To = "kklimarchuk@supremecouncil.org"
ObjMail.From = "kklimarchuk@supremecouncil.org"
ObjMail.Subject = "Form Submission"
ObjMail.Body = t1name & vbcrlf&_
t1
ObjMail.Send
Set ObjMail = Nothing
Response.Write"Thank You"
%>


Jon
__________________
Rgds

Jon

UK Link Exchange
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP not working in IIS5 on WinXP Pro cistate ASP 5 06-18-04 02:31 PM
Cdonts not working under exchange 2000 server environment Aribidesi ASP 1 06-04-04 11:03 AM
CDONTS not working noviceforever ASP 8 06-04-04 12:12 AM
If/else statement working...but not working mdhall PHP 13 10-16-03 08:47 AM
Problem with CDONTS javadude2003 ASP 23 08-07-03 11:09 PM


All times are GMT -5. The time now is 04:23 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.