Solved

Asp Reply button within a HTML email

Posted on 2006-10-24
3
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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