...

View Full Version : need help



beebee_kok
08-30-2005, 09:45 AM
here is my problem.i'd created a form and need to be submitted online to the receipient's email.i have created the backend coding and it really does send email to the receipient's email but there is no any data of the form.what is the matter here?what should i do so that the data in the form can be sent to the reciepient's email.here is my backend coding.thanks.

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.tmedutech.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "siewhien@tmedutech.com"
objCDOSYSMail.To = "tmet_siewhien@yahoo.com"
objCDOSYSMail.Subject = "Online form"
objCDOSYSMail.HTMLBody = ""
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
response.redirect("thank_you.asp")
%>

appreciate to those who help me to slove this out. :o

NancyJ
08-30-2005, 10:18 AM
um, looking at that I'm not suprised the email is blank.... you dont put the form data in it anywhere... you say

objCDOSYSMail.HTMLBody = ""
so thats what you get ;)

beebee_kok
08-30-2005, 11:21 AM
well what kind of data i should put in it?when i put the html format in it,there is an error.let say i gave u the source code of my form n i wish to put it in the Code:

objCDOSYSMail.HTMLBody = ""

what should i put?here i attach with my form source code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head>

<body>

<form name="frmCustomer" method="post" enctype="text/plain" action="mail.asp">
<p>Customer Name
<input name="txtCustomerName" type="text" id="txtCustomerName">
</p>
<p>Customer ID
<input name="txtCustomerID" type="text" id="txtCustomerID">
</p>
<p>Email
<input name="txtEmail" type="text" id="txtEmail">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>

i really out of idea of putting anything in it.pls help. :)

NancyJ
08-30-2005, 11:30 AM
well what kind of data i should put in it?

Whatever you want to be in the email.

for example:



body = ""
for each name in request.form
body = body & "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next

objCDOSYSMail.HTMLBody = body



when i put the html format in it,there is an error?

what error do you get?

beebee_kok
09-01-2005, 02:54 AM
thanks nancyj for helping me in this problem.but after i applied what you had taught,here comes another error.
Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/mail.asp, line 23
i really don't know whats wrong with it.
let me show you again the coding that i had applied.

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.tmedutech.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "siewhien@tmedutech.com"
objCDOSYSMail.To = "tmet_siewhien@yahoo.com"
objCDOSYSMail.Subject = "Online form"
body = ""
for each name in request.form
body = body & "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next
objCDOSYSMail.HTMLBody = body
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>


is there any mistake that i had done?pls advise.thanks.^-^

Quote:
Originally Posted by beebee_kok
when i put the html format in it,there is an error?
the error that i get is just because i copied all the html coding and pasted it into the body so it showed me the error.so now i knew that is a wrong method.

NancyJ
09-01-2005, 09:05 AM
Its your mail server that is the problem, try settting the sendusing to 1 instead of 2 that can help or it may be that you can only send mail internally on your server, try sending a message to an address on your domain.

This should help http://www.aspfaq.com/show.asp?id=2305

beebee_kok
09-01-2005, 09:36 AM
the site that u gave me is for cdonts which i can't try it on my pc since i m using windows xp.when i change the sendusing to 1,still cannot work.then i try to put this code in it,

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusingmethod") = cdoSendUsingPickup

the error that i got is

Error Type:
CDO.Message.1 (0x80040222)
The pickup directory path is required and was not specified.
/mail.asp, line 24


hmm....figuring what's the matter now. :confused: any idea???

NancyJ
09-01-2005, 10:18 AM
did you try using an internal address rather than a yahoo address? When I have encountered this error in the past it was using a local development server that was not set up to allow external emails, using an internal email address worked fine.
you could try adding this:
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"

The most likely problem is your mail server setup tho.

fwiw the link I gave you is cdosys not cdonts

beebee_kok
09-02-2005, 03:31 AM
now sending the mail have no more problem.but there is no data in it.i also dunno what is the problem now.i follow what u had taught me but it still got problem there.the data that i filled the form was not send to the receipients email.the body part i followed what u taught me but then still can't work it out.here is the coding again which can work out the sending mail but no data in it.

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.tmedutech.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "siewhien@tmedutech.com"
objCDOSYSMail.To = "chunchuan@tmedutech.com"
objCDOSYSMail.Subject = "Online form"
body = ""
for each name in request.form
body = body & "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next
objCDOSYSMail.HTMLBody = body
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>


what is the matter now???did i write something wrong there???can't figure out the problem since i followed all the steps that u taught me.

NancyJ
09-02-2005, 08:54 AM
are you sure the data is coming through from the form correctly...
try this:
for each name in request.form
response.write "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next

if this doesnt display anything then there is a problem with your form.
Check that you have method="post" on your form.

beebee_kok
09-02-2005, 10:39 AM
i'd change the coding to what u taught me but still fail.my form has the method="post".

<form name="frmCustomer" method="post" enctype="text/plain" action="mail.asp">

i still can't understand why the problem still occur.let me show u the coding that i done for my form n also the backend coding.

form:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head>

<body>

<form name="frmCustomer" method="post" enctype="text/plain" action="mail.asp">
<p>Customer Name
<input name="txtCustomerName" type="text" id="txtCustomerName">
</p>
<p>Customer ID
<input name="txtCustomerID" type="text" id="txtCustomerID">
</p>
<p>Email
<input name="txtEmail" type="text" id="txtEmail">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>


backend coding:

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.tmedutech.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "siewhien@tmedutech.com"
objCDOSYSMail.To = "chunchuan@tmedutech.com"
objCDOSYSMail.Subject = "Online form"
body = ""
for each name in request.form
response.write "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next
objCDOSYSMail.HTMLBody = body
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>


i have gone through all the lines n try to figure what is the problem but it still can't work.do u have any idea? :confused:

NancyJ
09-02-2005, 10:52 AM
what does the page display? It should display the names of the fields and their values.

NancyJ
09-02-2005, 10:55 AM
remove enctype="text/plain" from your form

beebee_kok
09-05-2005, 03:08 AM
in the page of mail.asp(backend coding) it does appear all the names and values of the fields but in my email there is nothing in it.i had erased the enctype=text/plain.the body of the mail have nothing in it.it should be to have all the fields names and the values in it but it didn't have anything.what's wrong with it?please advise. :( thanks

NancyJ
09-05-2005, 08:52 AM
change
body = ""
for each name in request.form
response.write "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next
back to


body = ""
for each name in request.form
body = body& "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
next


that was merely to test if the form was posting properly ;)

beebee_kok
09-05-2005, 10:44 AM
thanks nancyj....i'd solved the problem and get what i want.thanks for your helping hands. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum