Solved

Asp Reply button within a HTML email

Posted on 2006-10-24
3
234 Views
Last Modified: 2008-03-10
Hello Experts,

I have developed a site for a client that has a contact me page with a self sending feedback form written in ASP. The user of the web site can contact or ask my client a question via this form. When the user of the site submits the form the information the user submitted is emailed to my client in a HTML formatted email. It is also BCC to me so I know my client has received a question from a user of the site.

My client receives the email which 90% of the time is a question that other users of the site may be interested in. My client uses MS Outlook and clicks the reply button to answer the submitted question. Initially he was supposed to BCC me his answer and I would review it for grammar errors and then post it to the web site on the FAQ page. However he always doesn’t BCC I, and I have to follow up with him to update his site.

I want to create a link in the HTML email he receives that he can click on which will populate the TO: field in the MS outlook with the user of the site who submitted the question (the user must enter an email before the email is submitted through CDOSYS) and BCC myself.

I have tried using the variable I declared in the formatting of the HTML email but on my test email I get when I click the reply link Outlook leaves the TO: blank. I can input an email address into my code and populate the TO: text box but I’m unable to populate the TO: text box with the variable of the user’s email.

Below is my code from the contact us page that also formats the HTML email my click receives.

Thanks in advance.

........................................
THE HTML FORM
.......................................

<%
'If the form has not been submitted execute the following code
If Request.Form="" Then
%>


<form method="post" action="contact.asp" name="Request" ID="Request">
<div align="left"><h3>Ask ME Your Question</h3>
<br>
</div>
<div align="center">
<table width="85%" border="0" ID="Table2">
<tr>
<td align="right"><p>Name</p></td>
<td>
<input type="text" name="txtName" ID="Text1">
</td>
</tr>

<tr>
<td align="right"><p>Street Address</p></td>
<td>
<input type="text" name="txtAddress" ID="Text3">
</td>
</tr>

<tr>
<td align="right"><p>City</p></td>
<td>
<input type="text" name="txtCity" ID="Text4">
</td>
</tr>

<tr>
<td align="right"><p>State</p></td>
<td>
<!--#Include file="includes/select_state.inc" -->
</td>
</tr>

<tr>
<td align="right"><p>Zip Code</p></td>
<td>
<input type="text" name="txtZip" ID="Text5" size="10">
</td>
</tr>

<tr>
<td align="right"><p>Phone Number</p></td>
<td>
<input type="text" name="txtPhone" ID="Text6" size="14">
</td>
</tr>


<tr>
<td align="right"><p>Your email<font color="#ff0033">*</font></p></td>
<td>
<input type="text" name="txtEmail" ID="Text2">
</td>
</tr>
<tr>
<td nowrap align="right"><p>Your Question</p></td>
<td>
<textarea name="txtFeedback" cols="40" rows="7" ID="Textarea1"></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="Submit" ID="Submit1">
<input type="reset" name="Reset" value="Reset" ID="Reset1">
</td>
</tr>
<tr>
<td nowrap align="center"><font color="#ff0033"> * Required Fields</font></td>
</tr>
</table>
</div>
</form>
<br>

..................................
MY VARIABLES
.................................
<%
'If the form has been submitted execute the following code  
Else
%>


<%
'receive the form values
Dim sName, sEmail, sFeedback
sName=Request.Form("txtName")
sAddress=Request.Form("txtAddress")
sCity=Request.Form("txtCity")
sState=Request.Form("State")
sZip=Request.Form("txtZip")
sPhone=Request.Form("txtPhone")
sEmail=Request.Form("txtEmail")
sFeedback=Request.Form("txtFeedback")

LoginMessage=("Please enter an email address.")

%>

..................................................
HTML EMAIL
.................................................
<%
' create the HTML formatted email text
Dim sEmailText
sEmailText = sEmailText & "<html>"
sEmailText = sEmailText & "<head>"
sEmailText = sEmailText & "<title>HTML Email</title>"
sEmailText = sEmailText & "</head>"
sEmailText = sEmailText & "<body>"
sEmailText = sEmailText & "<strong>Question for MEfrom</strong>: " & sName & "<br>"
sEmailText = sEmailText & "<strong>Address:</strong>" & sAddress & "<br>"
sEmailText = sEmailText & "<strong>City:</strong>" & sCity & "<br>"
sEmailText = sEmailText & "<strong>State:</strong>" & sState & "<br>"
sEmailText = sEmailText & "<strong>Zip:</strong>" & sZip & "<br>"
sEmailText = sEmailText & "<strong>Phone Number:</strong>" & sPhone & "<br>"
sEmailText = sEmailText & "<strong>Message:</strong><br>" & sFeedback & "<br>"
sEmailText = sEmailText & "<strong>Date & Time:</strong>" & Now() & "<br>"
sEmailText = sEmailText & "<strong>IP :</strong>" & Request.ServerVariables("REMOTE_ADDR")& "<br>"

..........................................................................
THE LINE OF CODE I'M HAVING AN ISSUE WITH
.........................................................................
sEmailText = sEmailText & "<a href=""sEmail""?&bcc=""mailto: ME@gmail.com "">REPLY here</a>"
sEmailText = sEmailText & "</body>"
sEmailText = sEmailText & "</html>"
%>


............................
MAIL OBJECT
...........................
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Question for Me"
myMail.From=sEmail
myMail.To="client@gmail.com"
myMail.BCC="me@gmail.com

myMail.HTMLBody=sEmailText
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.10.10.96"
'Server port
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>


<h3>
<%
Response.write "<div align='center'>Thank you for your question .<br>"
Response.Write "I will get back to you soon.</div>"
%>
</h3>





<%
End if
%>
0
Comment
Question by:Eric_Trogdon
  • 2
3 Comments
 

Author Comment

by:Eric_Trogdon
ID: 17799143
Just realized I had the wrong syntax copied. Here is what I have.

sEmailText = sEmailText & "<a href=""mailto:""sEmail""?&bcc=ME@gmail.com "">REPLY here</a>"
0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 17799275
Change it to

sEmailText = sEmailText & "<a href=""mailto:" & sEmail & "?bcc=ME@gmail.com"">REPLY here</a>"
0
 

Author Comment

by:Eric_Trogdon
ID: 17799789
thank you.  I could have sworn I tried that thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now