944,133 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 4062
  • ASP RSS
Mar 16th, 2006
0

Use of ASP, mailforms, & Dreamweaver

Expand Post »
Greetings!

I'm new to this community and so please be gentle with me as I figure out how it works, where things are, and what the general polity is.

Situation: Our non-profit's website is hosted in a Windows environment. CGI is not available to me, but there is an ASP mail feature. I'm guessing that if they "give" me that, I can upload another ASP mail utility and do it better. Website has email addresses listed and we're already starting to get spam. I was warned, and the guy that built the site was warned by several folks (including me), but was not willing to explore possibilties before getting the site "live". Live and delete spam, I guess.

Site was built and is maintained in Dreamweaver.

What I want to do is to employ a mail form to allow visitors to the site to contact one of three officers or the webmaster, to choose "Question, Comment, Opinion, Other" by a second dropdown, add their name, email addy, and comments as required fields, and have the data sent to the appropriate address by form rather than by providing an electronically recognizable email address for each of the folks. All this without providing fodder for the webcrawlers!

Questions:

Can I do this in ASP, or do I need to be looking elsewhere?

Do I need to be POSTING elsewhere to ask this?

Can this be done in an elegant fashion or are we stuck with leaving the email addies on the site?

Have I left anything else out that would help me fix this or to ask it in a more easily digested way?

Please, oh PLEASE do not answer in tech-ese or in Geek. I don't always understand deeply technical. As I said earlier, be gentle with me. I execute instructions well, so long as I can understand them!

Thanks in advance!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Woodminer is offline Offline
2 posts
since Mar 2006
Mar 23rd, 2006
0

Re: Use of ASP, mailforms, & Dreamweaver

Hello,
Here is a simple email function which you can use to send the emails from the web forms. For the spam i would suggest you not to disclose that page to the search bots. You can hide the direct html link of that page and use the javascript, so that only the visitor can access that page by clicking on the link. i.e.
ASP Syntax (Toggle Plain Text)
  1. <a href="#" onclick="window.open('url')">Email Form</a>

And here is the ASP function to use.

ASP Syntax (Toggle Plain Text)
  1. Function Sendmail(MailFromAddr, RecipientAddr, cSubject, strMsgInfo, sCc, sBcc, iPriority, RecipientName, cMailHost,cMailFromName,attachment,HTMLMail)
  2.  
  3. IF instr(strMsgInfo,"<")<>0 then ' This is HTML content
  4.  
  5. HTMLMail=true
  6.  
  7. ELSE
  8.  
  9. HTMLMail=false
  10.  
  11. END IF
  12.  
  13.  
  14.  
  15. On Error Resume Next
  16.  
  17. 'Dimension variables
  18.  
  19. Dim objCDOSYSCon
  20.  
  21.  
  22.  
  23. 'Create the e-mail server object
  24.  
  25. Set objCDOSYSMail = Server.CreateObject("CDO.Message")
  26.  
  27. Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
  28.  
  29.  
  30.  
  31. 'Set and update fields properties
  32.  
  33. 'Out going SMTP server
  34.  
  35. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost
  36.  
  37. 'SMTP port
  38.  
  39. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  40.  
  41. 'CDO Port
  42.  
  43. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  44.  
  45. 'Timeout
  46.  
  47. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 600
  48.  
  49. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  50.  
  51. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
  52.  
  53. objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password
  54.  
  55. objCDOSYSCon.Fields.Update
  56.  
  57.  
  58.  
  59. 'Update the CDOSYS Configuration
  60.  
  61. Set objCDOSYSMail.Configuration = objCDOSYSCon
  62.  
  63.  
  64.  
  65.  
  66.  
  67. 'Who the e-mail is from
  68.  
  69. objCDOSYSMail.From = "<" & MailFromAddr& ">"
  70.  
  71.  
  72.  
  73. 'mail carbon copy
  74.  
  75. objCDOSYSMail.Cc = "<" & sCc & ">"
  76.  
  77.  
  78.  
  79. objCDOSYSMail.Bcc = "<" & sBcc & ">"
  80.  
  81.  
  82.  
  83. 'Who the e-mail is sent to
  84.  
  85. objCDOSYSMail.To = "<" & RecipientAddr& ">"
  86.  
  87.  
  88.  
  89. 'The subject of the e-mail
  90.  
  91. objCDOSYSMail.Subject = cSubject
  92.  
  93.  
  94.  
  95. If CBool( HTMLMail ) Then
  96.  
  97.  
  98.  
  99. objCDOSYSMail.HTMLBody = strMsgInfo
  100.  
  101. Else
  102.  
  103. objCDOSYSMail.TextBody = strMsgInfo
  104.  
  105. End If
  106.  
  107. 'Send the e-mail
  108.  
  109. objCDOSYSMail.Send
  110.  
  111.  
  112.  
  113. 'Close the server mail object
  114.  
  115. Set objCDOSYSMail = Nothing
  116. End Function
  117.  
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
msaqib is offline Offline
91 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: hi problem in dropdown list
Next Thread in ASP Forum Timeline: Global and session var.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC