Reply to topic
ASP form 'sender email'
Chijo


Joined: 23 Jul 2004
Posts: 3
Reply with quote
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
HostMySite Sales Rep

Joined: 19 Mar 2004
Posts: 858
Location: Newark, De
Reply with quote
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


Joined: 23 Jul 2004
Posts: 3
Reply with quote
Thanks!

changed the script and now it works...my client's happy.

thanks a lot for your help.

Chijo
ASP form 'sender email'
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic