Author |
Topic  |
esahc
Starting Member
47 Posts |
Posted - 02 June 2001 : 21:29:38
|
I've got a form with the following fields...
name title company address e_mail phone to model
I need to send the results of these fields to an e-mail address when the submit button is pressed using CDONTS. anyone have the code I would need to do this? also - name and phone are required fields.
|
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 June 2001 : 06:45:06
|
Try something like this:
if request.servervariables("REQUEST_METHOD") = "POST" then
Dim str_name, str_title, str_company, str_address, str_e_mail, str_phone, str_to, str_model
str_name = Request.Form("name") str_title = Request.Form("title") str_company = Request.Form("company") str_address = Request.Form("address") str_e_mail = Request.Form("e_mail") str_phone = Request.Form("phone") str_to = Request.Form("to") str_model = Request.Form("model")
Dim objCDO, strBody
strBody = strBody & "Name = " & str_name & vbNewLine strBody = strBody & "Title = " & str_title & vbNewLine strBody = strBody & "Company = " & str_company & vbNewLine strBody = strBody & "Address = " & str_address & vbNewLine strBody = strBody & "E-mail = " & str_e_mail & vbNewLine strBody = strBody & "Phone# = " & str_phone & vbNewLine strBody = strBody & "To = " & str_to & vbNewLine strBody = strBody & "Model = " & str_model & vbNewLine
Set objCDO = Server.CreateObject("CDONTS.NewMail") objCDO.From = "From address" objCDO.Subject = "subject" objCDO.To = "to adress" objCDO.Body = strBody
on error resume next
objCDO.Send Set objCDO = Nothing
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 03 June 2001 : 07:35:42
|
tried it... dunno if it worked yet - haven't gotten any e-mails. I'll post back when I get it... (if?)
|
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 June 2001 : 07:44:16
|
the mail should be almost instant. post the contents of your page here so i can have a look at it.
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 03 June 2001 : 08:10:32
|
<% if request.servervariables("REQUEST_METHOD") = "POST" then
Dim str_name, str_title, str_company, str_address, str_e_mail, str_phone, str_to, str_model
strName = Request.Form("name") strTitle = Request.Form("title") strCompany = Request.Form("company") strAddress = Request.Form("address") strEmail = Request.Form("e_mail") strPhone = Request.Form("phone") strTo = Request.Form("to") strModel = Request.Form("model")
Dim objCDO, strBody
strBody = strBody & "Name = " & strName & vbNewLine strBody = strBody & "Title = " & strTitle & vbNewLine strBody = strBody & "Company = " & strCompany & vbNewLine strBody = strBody & "Address = " & strAddress & vbNewLine strBody = strBody & "E-mail = " & strEmail & vbNewLine strBody = strBody & "Phone# = " & strPhone & vbNewLine strBody = strBody & "To = " & strTo & vbNewLine strBody = strBody & "Model = " & strModel & vbNewLine
Set objCDO = Server.CreateObject("CDONTS.NewMail") objCDO.From = Request.Form( "Email" ) objCDO.Subject = "***CUSTOMER PRODUCT REQUEST INFO***" objCDO.To = "micchamck@aol.com" objCDO.Body = strBody
on error resume next
objCDO.Send Set objCDO = Nothing End If %>
nothing wraps incorrectly in my editor... and the action should be the page itself, correct?
|
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 June 2001 : 08:36:23
|
yes.
<form name="form1" action="" method="POST">
|
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 June 2001 : 08:37:39
|
try taking the on error resume next off the page and see if any error occur.
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 03 June 2001 : 08:49:18
|
still nothing...
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 03 June 2001 : 08:52:09
|
no errors...
|
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 June 2001 : 09:29:50
|
the problem must be with the setup/configeration af CDONTS on the server.
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 03 June 2001 : 09:54:34
|
anyway to fix/change/play with it??
|
 |
|
Syedur
New Member

USA
93 Posts |
Posted - 03 June 2001 : 22:28:35
|
Hey guys, I am a beginner ASP. So, I really wouldn't know about this... But tell you what! I can give you a hint: If you are using the snitz forum in your server and cdonts mails are running just fine. Try taking the pop_mail.asp and modifing it to something you want! Here.. you might want to look at this form setup for pop_mail.asp (it will let you input values).<form action="pop_mail.asp?mode=DoIt&id=<% =Request.QueryString("ID") %>" method=Post id=Form1 name=Form1> <input type=hidden name="Page" value="<% =Request.QueryString("page") %>">
<table border="0" width="90%" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="<% =strPopUpBorderColor %>"> <table border="0" width="100%" cellspacing="1" cellpadding="1"> <tr> <td bgColor=<% =strPopUpTableColor %> align="right" nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Send To Name:</FONT></b></td> <td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =rs("M_NAME") %><input type=text name="Name" value=""></font></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> align="right" nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Send To Email:</FONT></b></td> <td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =rs("M_EMAIL") %><input type=text name="Email" value=""></font></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> align="right" nowrap><b><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>>Your Name:</font></b></td> <td bgColor=<% =strPopUpTableColor %>><input name=YName type=text value="" size=25><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>></font></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> align="right" nowrap><b><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>>Your Email:</font></b></td> <td bgColor=<% =strPopUpTableColor %>><input name=YEmail type=text value="" size=25><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>></font></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> colspan=2><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Message:</FONT></b></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> colspan=2><textarea name="Msg" cols=40 rows=5></textarea></td> </tr> <tr> <td bgColor=<% =strPopUpTableColor %> colspan=2 align=center><Input type=Submit value="Send" id=Submit1 name=Submit1></TD> </tr> </table> </td> </tr> </table> </form>
There is a time in every man’s education when he arrivers at the conviction that envy is ignorance; that imitation is suicide. |
 |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 04 June 2001 : 17:37:09
|
Where are you hosting your page? Does your hosting company offer CDONTS for the account that you have? Go to http://forum.snitz.com/archive/redirect.asp?linkid=36 , install and run the file on your server and it will tell you if CDONTS is available for you.
Thanks,
Mo |
 |
|
esahc
Starting Member
47 Posts |
Posted - 05 June 2001 : 02:15:46
|
done that already... I got CDONTS, and Chili!Mail... CDONTS hasn't been working, and I don't know/have a server to use for Chili!Mail...
|
 |
|
chinh10
Junior Member
 
125 Posts |
Posted - 05 June 2001 : 18:14:37
|
Make sure your port (25) is open to send an email
|
 |
|
esahc
Starting Member
47 Posts |
Posted - 05 June 2001 : 19:02:23
|
server isn't on my system...
|
 |
|
Topic  |
|