Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: need help

  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help

    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.

  • #2
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    um, looking at that I'm not suprised the email is blank.... you dont put the form data in it anywhere... you say
    Code:
    objCDOSYSMail.HTMLBody = ""
    so thats what you get

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by beebee_kok; 08-30-2005 at 10:26 AM.

  • #4
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    Quote Originally Posted by beebee_kok
    well what kind of data i should put in it?
    Whatever you want to be in the email.

    for example:

    Code:
     
    body = ""
    for each name in request.form 
    body = body & "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
    next
    
    objCDOSYSMail.HTMLBody = body
    Quote Originally Posted by beebee_kok
    when i put the html format in it,there is an error?
    what error do you get?

  • #5
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    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

  • #7
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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. any idea???

  • #8
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    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

  • #9
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #10
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    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.

  • #11
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #12
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    what does the page display? It should display the names of the fields and their values.

  • #13
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    remove enctype="text/plain" from your form

  • #14
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #15
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    change
    Code:
    body = ""
    for each name in request.form
    response.write "<b>"&mid(name, 3, len(name))&": </b>"&request.form(name)&"<br />"
    next
    back to
    Code:
    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


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •