Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

HELP.......Could anyone correct me mistake.......NEED HELP

Hi

Cold someone tell me what's go wrong with this code:

this file name is "form.htm"

[code]
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>


Untitled Document






Your Name:

Your E-Mail:

Your Message:





[/code]
This file name is somescript.asp
[code]
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>



Untitled Document







<%
' Check if it's a postback. This is only really useful if you
' have the form submit to itself (since you only want to send
' the email when the user hits submit, not when the page first loads
if (Request.Form("Postback") = "true") then
set objEmail = Server.CreateObject("CDONTS.NewMail")
objEmail.To = "airwinx@yahoo.com.sg"
objEmail.From = Request.Form("txtEmail")
objEmail.Body = "Message From " & Request.Form("txtName") & ": " & Request.Form("txtMessage")
objEmail.Send
set objEmail = nothing
end if
%>


[/code]

My plan for this code is to let user type in some info at "form.htm" and press the submit butn, once press, it will sent the info to my email.

The above sample code was provided by one of the member in programheavens. I had use this code for testing purpose. But the problem is I didn't receive the mail after pressing the submit btn. Do I miss out something in th code or my format is wrong, please correct me ..............appreciated !

Could anyone help me to spot any error, cos I am new to html & asp.

You are allow to use this code for testing purpose, just cut and paste, I had cut & paste the full code at above.



regards
wong

Comments

  • ssvasanssvasan Posts: 101Member
    : Hi
    :
    : Cold someone tell me what's go wrong with this code:
    :
    : this file name is "form.htm"
    :
    : [code]
    : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    :
    :
    : Untitled Document
    :
    :
    :
    :
    :
    :
    : Your Name:
    : Your E-Mail:
    : Your Message:
    :
    :
    :
    :
    : [/code]
    : This file name is somescript.asp
    : [code]
    : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    :
    :
    :
    : Untitled Document
    :
    :
    :
    :
    :
    :
    :
    : <%
    : ' Check if it's a postback. This is only really useful if you
    : ' have the form submit to itself (since you only want to send
    : ' the email when the user hits submit, not when the page first loads
    : if (Request.Form("Postback") = "true") then
    : set objEmail = Server.CreateObject("CDONTS.NewMail")
    : objEmail.To = "airwinx@yahoo.com.sg"
    : objEmail.From = Request.Form("txtEmail")
    : objEmail.Body = "Message From " & Request.Form("txtName") & ": " & Request.Form("txtMessage")
    : objEmail.Send
    : set objEmail = nothing
    : end if
    : %>
    :
    :
    : [/code]
    :
    : My plan for this code is to let user type in some info at "form.htm" and press the submit butn, once press, it will sent the info to my email.
    :
    : The above sample code was provided by one of the member in programheavens. I had use this code for testing purpose. But the problem is I didn't receive the mail after pressing the submit btn. Do I miss out something in th code or my format is wrong, please correct me ..............appreciated !
    :
    : Could anyone help me to spot any error, cos I am new to html & asp.
    :
    : You are allow to use this code for testing purpose, just cut and paste, I had cut & paste the full code at above.
    :
    :
    :
    : regards
    : wong
    :

    Hi,

    I did not see any of your code, the following is a code which sends mail directly to the address specified in the action part of the form element.
















    Name:



    Email:




    Comment:



     





    - srinivasan,


  • ManningManning Posts: 1,621Member
    : Hi
    :
    : Cold someone tell me what's go wrong with this code:
    :
    : this file name is "form.htm"
    :
    : [code]
    : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    :
    :
    : Untitled Document
    :
    :
    :
    :
    :
    :
    : Your Name:
    : Your E-Mail:
    : Your Message:
    :
    :
    :
    :
    : [/code]
    : This file name is somescript.asp
    : [code]
    : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    :
    :
    :
    : Untitled Document
    :
    :
    :
    :
    :
    :
    :
    : <%
    : ' Check if it's a postback. This is only really useful if you
    : ' have the form submit to itself (since you only want to send
    : ' the email when the user hits submit, not when the page first loads
    : if (Request.Form("Postback") = "true") then
    : set objEmail = Server.CreateObject("CDONTS.NewMail")
    : objEmail.To = "airwinx@yahoo.com.sg"
    : objEmail.From = Request.Form("txtEmail")
    : objEmail.Body = "Message From " & Request.Form("txtName") & ": " & Request.Form("txtMessage")
    : objEmail.Send
    : set objEmail = nothing
    : end if
    : %>
    :
    :
    : [/code]
    :
    : My plan for this code is to let user type in some info at "form.htm" and press the submit butn, once press, it will sent the info to my email.
    :
    : The above sample code was provided by one of the member in programheavens. I had use this code for testing purpose. But the problem is I didn't receive the mail after pressing the submit btn. Do I miss out something in th code or my format is wrong, please correct me ..............appreciated !
    :
    : Could anyone help me to spot any error, cos I am new to html & asp.
    :
    : You are allow to use this code for testing purpose, just cut and paste, I had cut & paste the full code at above.


    What kind of error are you getting, if any? There are a couple things that might cause problems:

    1) You may not have the CDONTS.NewMail object
    2) The email doesn't have a subject. Maybe it'll refuse to send if one is not there. Try adding objEmail.Subject = "Test" before calling objEmail.Send

    Probably other reasons but those are the two I can think if off-hand.
  • cholancholan Posts: 21Member
    Check your Mailroot Queue.. whether ur mail is added in the queue.. if it is there means... check ur SMTP service whether it is started or not...

    Cholan


    : : Hi
    : :
    : : Cold someone tell me what's go wrong with this code:
    : :
    : : this file name is "form.htm"
    : :
    : : [code]
    : : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    : :
    : :
    : : Untitled Document
    : :
    : :
    : :
    : :
    : :
    : :
    : : Your Name:
    : : Your E-Mail:
    : : Your Message:
    : :
    : :
    : :
    : :
    : : [/code]
    : : This file name is somescript.asp
    : : [code]
    : : <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    : :
    : :
    : :
    : : Untitled Document
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : : <%
    : : ' Check if it's a postback. This is only really useful if you
    : : ' have the form submit to itself (since you only want to send
    : : ' the email when the user hits submit, not when the page first loads
    : : if (Request.Form("Postback") = "true") then
    : : set objEmail = Server.CreateObject("CDONTS.NewMail")
    : : objEmail.To = "airwinx@yahoo.com.sg"
    : : objEmail.From = Request.Form("txtEmail")
    : : objEmail.Body = "Message From " & Request.Form("txtName") & ": " & Request.Form("txtMessage")
    : : objEmail.Send
    : : set objEmail = nothing
    : : end if
    : : %>
    : :
    : :
    : : [/code]
    : :
    : : My plan for this code is to let user type in some info at "form.htm" and press the submit butn, once press, it will sent the info to my email.
    : :
    : : The above sample code was provided by one of the member in programheavens. I had use this code for testing purpose. But the problem is I didn't receive the mail after pressing the submit btn. Do I miss out something in th code or my format is wrong, please correct me ..............appreciated !
    : :
    : : Could anyone help me to spot any error, cos I am new to html & asp.
    : :
    : : You are allow to use this code for testing purpose, just cut and paste, I had cut & paste the full code at above.
    :
    :
    : What kind of error are you getting, if any? There are a couple things that might cause problems:
    :
    : 1) You may not have the CDONTS.NewMail object
    : 2) The email doesn't have a subject. Maybe it'll refuse to send if one is not there. Try adding objEmail.Subject = "Test" before calling objEmail.Send
    :
    : Probably other reasons but those are the two I can think if off-hand.
    :

Sign In or Register to comment.