Print Page | Close Window

ASP Email function

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=29178
Printed Date: 28 March 2026 at 6:01am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP Email function
Posted By: shanerobinson
Subject: ASP Email function
Date Posted: 10 March 2011 at 9:30am
Is it possible to make the Send Mail object dynamic?

At the moment a form is filled in on the website including the visitors e-mail address but when the messages is sent to us if you try to reply to the message, your just replying to your self and not the visitors mail address.


ObjSendMail.From = "tech@mydomain.com"

Thanks.



Replies:
Posted By: dpyers
Date Posted: 10 March 2011 at 6:37pm
What email component are you using?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: WebWiz-Bruce
Date Posted: 11 March 2011 at 10:46am
It can be set dynamically:-

strUserEmail = Request.Form("Email")

ObjSendMail.From = strUserEmail

However, when you read the visitors email address from the form you should check that it is a valid email address format and that you remove < and > as well as ; so that a spammer can not trick the component in to relaying spam from your website.

You should also add CAPTCHA to prevent remote form submission to prevent bots submitting 1,000's of emails per minute.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: shanerobinson
Date Posted: 25 March 2011 at 3:52pm
Thanks bruce that works a treat, i will try and set up the captcha now.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net