User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 375,198 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,036 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 607 | Replies: 2
Reply
Join Date: Sep 2007
Posts: 15
Reputation: cutebab is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
cutebab cutebab is offline Offline
Newbie Poster

email sending form....help

  #1  
Apr 1st, 2008
hi ,


I hav developed a contact us form for a site in asp...
but when i press submit button its not sending mail......
iam using windows server with XP OS................

I hav pasted the code below.......Plz go thru it ......n try it so that it is workin........
if not plz provide me a workin model ..................
Plz.....help me out...........

regards,
cutebab


  1. <html>
  2. <head>
  3. <title>Feedback Form</title>
  4. </head>
  5. <body bgcolor="#FFFFFF">
  6. <%
  7. If Request.Form="" Then %>
  8. <form method="post" action="file:///C|/DOCUME%7E1/MRC%7E1.SAD/LOCALS%7E1/Temp/Temporary%20Directory%202%20for%20feedback.zip/feedback.asp" name="form1">
  9. <div align="center">Send us your Feedback.<br>
  10. <br>
  11. </div>
  12. <div align="center">
  13. <table width="75%" border="0">
  14. <tr>
  15. <td>Name</td>
  16. <td>
  17. <input type="text" name="txtName">
  18. </td>
  19. </tr>
  20. <tr>
  21. <td>Email</td>
  22. <td>
  23. <input type="text" name="txtEmail">
  24. </td>
  25. </tr>
  26. <tr>
  27. <td>Comments</td>
  28. <td>
  29. <textarea name="txtFeedback" cols="40" rows="7"></textarea>
  30. </td>
  31. </tr>
  32. <tr>
  33. <td>&nbsp;</td>
  34. <td>&nbsp;</td>
  35. </tr>
  36. <tr>
  37. <td>&nbsp;</td>
  38. <td>
  39. <input type="submit" name="Submit" value="Submit">
  40. <input type="reset" name="Reset" value="Reset">
  41. </td>
  42. </tr>
  43. </table>
  44. </div>
  45. </form>
  46. <br>
  47. <%
  48. Else
  49.  
  50. 'receive the form values
  51. Dim sName, sEmail, sFeedback
  52. sName=Request.Form("txtName")
  53. sEmail=Request.Form("txtEmail")
  54. sFeedback=Request.Form("txtFeedback")
  55.  
  56. ' create the HTML formatted email text
  57. Dim sEmailText
  58. sEmailText = sEmailText & "<html> "
  59. sEmailText = sEmailText & "<head>"
  60. sEmailText = sEmailText & "<title>HTML Email</title>"
  61. sEmailText = sEmailText & "</head>"
  62. sEmailText = sEmailText & "<body>"
  63. sEmailText = sEmailText & "<font color='#00000' size='2' face='Verdana'>"
  64. sEmailText = sEmailText & "Feedback message from: " & sName & "<br>"
  65. sEmailText = sEmailText & "Message:" & sFeedback & "<br>"
  66. sEmailText = sEmailText & "Date & Time:" & Now() & "<br>"
  67. sEmailText = sEmailText & "IP :" & Request.ServerVariables("REMOTE_ADDR")
  68. sEmailText = sEmailText & "</font>"
  69. sEmailText = sEmailText & "</body>"
  70. sEmailText = sEmailText & "</html>"
  71.  
  72.  
  73. 'create the mail object
  74. Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
  75. NewMailObj.From=sEmail 'This is the email of the feedback sender
  76. NewMailObj.To = "cjk@yahoo.com" 'change to your address
  77. NewMailObj.Subject = "Feedback"
  78. NewMailObj.Body = sEmailText
  79. 'you need to add these 2 lines for the mail to be sent in HTML format
  80. 'remove them and the email will be sent in Text format
  81. NewMailObj.BodyFormat = 0
  82. NewMailObj.MailFormat = 0
  83. NewMailObj.Send
  84. Set NewMailObj=Nothing
  85.  
  86. Response.write "<div align='center'>Thank you for sending your feedback.<br>"
  87. Response.write "We will get back to you if necessary.</div>"
  88. End If
  89. %>
  90. </body>
  91. </html>
Last edited by peter_budo : Apr 1st, 2008 at 7:26 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 15
Reputation: cutebab is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
cutebab cutebab is offline Offline
Newbie Poster

Re: email sending form....help

  #2  
Apr 1st, 2008
Tnx for editing the code........

hav u made any changes in the code n tested it whether it works..............
i hav tried it in my server n its not workin..............
is this code use Smtp mail server...........
plz reply...............
Reply With Quote  
Join Date: Apr 2008
Posts: 34
Reputation: pmpn is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
pmpn pmpn is offline Offline
Light Poster

Re: email sending form....help

  #3  
Apr 13th, 2008
your form action value is wrong.

you can just set action ="" in form tag
i hope that will solve this issue
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 2:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC