Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 CDONTS question...
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

esahc
Starting Member

47 Posts

Posted - 02 June 2001 :  21:29:38  Show Profile
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  Show Profile  Send RaiderUK a Yahoo! Message
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



Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 03 June 2001 :  07:35:42  Show Profile
tried it... dunno if it worked yet - haven't gotten any e-mails. I'll post back when I get it... (if?)

Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 June 2001 :  07:44:16  Show Profile  Send RaiderUK a Yahoo! Message
the mail should be almost instant. post the contents of your page here so i can have a look at it.

Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 03 June 2001 :  08:10:32  Show Profile

<%
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?

Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 June 2001 :  08:36:23  Show Profile  Send RaiderUK a Yahoo! Message
yes.

<form name="form1" action="" method="POST">

Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 June 2001 :  08:37:39  Show Profile  Send RaiderUK a Yahoo! Message
try taking the
on error resume next
off the page and see if any error occur.

Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 03 June 2001 :  08:49:18  Show Profile
still nothing...

Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 03 June 2001 :  08:52:09  Show Profile
no errors...

Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 June 2001 :  09:29:50  Show Profile  Send RaiderUK a Yahoo! Message
the problem must be with the setup/configeration af CDONTS on the server.

Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 03 June 2001 :  09:54:34  Show Profile
anyway to fix/change/play with it??

Go to Top of Page

Syedur
New Member

USA
93 Posts

Posted - 03 June 2001 :  22:28:35  Show Profile  Visit Syedur's Homepage  Send Syedur an AOL message  Send Syedur an ICQ Message  Send Syedur a Yahoo! Message
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.
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 04 June 2001 :  17:37:09  Show Profile  Send mafifi an ICQ Message
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
Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 05 June 2001 :  02:15:46  Show Profile
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...

Go to Top of Page

chinh10
Junior Member

125 Posts

Posted - 05 June 2001 :  18:14:37  Show Profile
Make sure your port (25) is open to send an email

Go to Top of Page

esahc
Starting Member

47 Posts

Posted - 05 June 2001 :  19:02:23  Show Profile
server isn't on my system...

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000 Version 3.4.07