![]() |
| ASP form 'sender email' |
|
Chijo
|
I'm using the ASP script for sending form info from one of my sites. My client is wanting the 'from' field of the email to show/use the email of the person submitting the form. that way they can just hit reply to send a response back to the person submitting the form. How do I tie that into the code so it uses the email that is submitted in the form?
Mailer.FromName = "websiteOrAnything" Mailer.FromAddress= "name@yourdomain.com" Am i using this portion of the code? Is this possible? thanks, Chijo |
||||||||||||
|
|
|||||||||||||
|
jamie
HostMySite Sales Rep
![]()
|
Instead of putting an exact address in your code, you're going to need to take that information directly from the form that submits to the ASPmail action page. Here's a snippet from www.serverobjects.com, the vendor for this product:
Form Handling All or partial input for a message may come from a form. For example, a form posted to the server with a request method of GET (i.e. <form action="/scripts/AspMail.asp" method=get>) may provide the message recipient’s email address, subject and message text as follows: Mailer.AddRecipient Request.QueryString("ToName"), Request.QueryString("ToAddress") Mailer.Subject = Request.QueryString("Subject") Mailer.BodyText = Request.QueryString("MsgBody") The form may also use the POST method (i.e. <form action="/scripts/AspMail.asp" method=post>) in which case the code would look as follows: Mailer.AddRecipient Request.Form("ToName"), Request.Form("ToAddress") Mailer.Subject = Request.Form ("Subject") Mailer.BodyText = Request.Form ("MsgBody") You can use any mixture of static and dynamic data in setting the components properties as dictated by your needs. For example, you may wish to send the mail to a single user. In this case you could modify the code to look something like this: Mailer.AddRecipient "John Smith", "jsmith@alocalhost.com" Mailer.Subject = Request.QueryString("Subject") Mailer.BodyText = Request.QueryString("MsgBody") |
||||||||||||
|
|
|||||||||||||
|
Chijo
|
Thanks!
changed the script and now it works...my client's happy. thanks a lot for your help. Chijo |
||||||||||||
|
|
|||||||||||||
| ASP form 'sender email' |
|
||
|



