HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

Sender and Subject - how to show form elements in email
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
plunk



Joined: 18 Nov 2008
Posts: 2

Posted: Tue Nov 18, 2008 3:04 pm     Sender and Subject - how to show form elements in email  

Hi
My forms work well and I capture all the information in the body of the email such as name, email, reason for emailing, etc.

The problem is when I look in my inbox and view the "Sender" and "Subject Line", it is always the same. This is because I have hardcoded the sender and subject lines.

How can I make the inbox show the sender's email which was inputted in the form and the subject line show the subject. I know it involves making the red tags below match the form elements - but don't know how - thanks a lot!


Here is the code I am using (asp)

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Agency Front End "
Mailer.FromAddress= "infoatagency.com"
Mailer.ReplyTo = strEmail
Mailer.RemoteHost = "relay.activehost.com"
Mailer.AddRecipient "Info at Agency", "infoatagency.com"
Mailer.Subject = "Agency comment or question"
strMsgHeader = "Agency comment or question" & vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
vbCrLf & "Contact: " & Request.Form("Contact") & _
vbCrLf & "Company: " & Request.Form("Company") & _
vbCrLf & "Worknum: " & Request.Form("Worknum") & _
vbCrLf & "Reason: " & Request.Form("Reason") & _
vbCrLf & "Comments: " & Request.Form("Comments")


Corey Bryant



Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

Posted: Tue Nov 18, 2008 3:37 pm      

It is probably similar to Processing the Form with the JMail EMail Component.

Where you have
Code: Mailer.Subject = "Agency comment or question"
Try changing it to the name of the name of the field you have for the subject field on your form, maybe something like
Code: Mailer.Subject = subject

_________________
Corey
Virtual Office Solutions | Processing Credit Cards | Microsoft Expression Web Blog
plunk



Joined: 18 Nov 2008
Posts: 2

Posted: Tue Nov 18, 2008 4:01 pm      

Thanks ! That did it.

Actual code requires the Request.Form before it.
Request.Form("Reason")
That is what I was missing.

Thank you.
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> HTML Form
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group