Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Asp Reply button within a HTML email

Posted on 2006-10-24
3
Medium Priority
?
245 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 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