Forum Moderators: open

Message Too Old, No Replies

Hiding email address from Spambots

I want to put 'To' value within .asp code

         

The Cricketer

2:59 pm on Jul 7, 2004 (gmt 0)

10+ Year Member



I have a contact form on my website which uses asp and CDONTS. At the moment I have a dropdown select field which stores the email addresses that the user wants to send the email to.

eg.
<select name="recipient" size="1" value="<%=contactRecipient%>">

<option value="sales@widgetmonkey.com">Sales Department</option>
<option value="support@widgetmonkey.com">Service and Support Department</option>
__________________________________________
Then using code similar to this

contactRecipient = request.form("recipient")
__________________________________________
and this

objCDONTS.To = contactRecipient
__________________________________________
The form is sent to the relevent email address. The only thing is that I don't want the email addresses to be served to the browser like this so that spambots etc can read it.

Can anyone advise me on the code needed to substitute the appropriate email address in via the asp code, so that in the actual form there only a value such as 'support' and not 'support@widgetmonkey.com'.

Hope someone can advise.

Mr_Brutal

3:02 pm on Jul 7, 2004 (gmt 0)

10+ Year Member



Hiya,

could you not use

objCDONTS.To = contactRecipient & @widgetmonkey.com

and do exactly what u said in the select box?

Im not great on bots but it would have to be pretty clever to piece an email together from 2 pages right?

mcavill

3:09 pm on Jul 7, 2004 (gmt 0)

10+ Year Member



I guess along the same lines....

<select name="recipient">

<option value="sales">Sales Department</option>
<option value="support">Service and Support Department</option>
__________________________________________
Then using code similar to this

select case request("recipient")

case "sales"
contactRecipient = "sales@widgetmoney.com"
case "support"
contactRecipient = "sales@widgetmoney.com"
case else
contactRecipient = "catchall@widgetmoney.com"

end select
__________________________________________
and this

objCDONTS.To = contactRecipient

The Cricketer

1:19 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Thanks very much you two. I've gone with the initial solution suggested by Mr_Brutal, as it seemed pretty straight forward, although I may use the other solution in the future.

Thanks for your time folks.
Cheers