I am new to ASP development and really need some help. I am sending information from a web form and everything works fine getting the data, except the message value has a ,(comma) being added at the beginning of the message entered in the html form. Anyone have an idea? I've been working for this for days and don't have a clue as to why this is happening.
This is a section of the form code:
<form method="POST" action="email_send.asp">
<td colspan="1"><font size="1" face="VERDANA, ARIAL"><b><BR>
Request or Comment:</b></font><font size="2" face="VERDANA, ARIAL"><b><BR>
</b></font><font face="VERDANA"><textarea name="message" rows="3" cols="45" wrap="auto" ></textarea></font>
<td><font size="" face="ARIAL" ><BR><input type="submit" value="Send Message" ></font><BR>
<BR><font face="ARIAL"><INPUT TYPE="RESET" VALUE="Reset Form" ></font></td>
Here is the ASP file: email_send.asp
<%
'Sends an email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = "
gclarkox@direcway.com"
mail.From = Request.Form("email")
mail.Subject ="Website request or comment"
mail.HTMLBody ="<h5>Name: </h5>" & Request.Form("title") &(" ") & Request.Form("name") & "<h5>Company: </h5>"& Request.Form("company") & "<h5>EMail Address: </h5>"& Request.Form("email") &"<h5>Address: </h5>" & Request.Form("address") &"<h5>Phone #: </h5>"& Request.Form("phone") &"<h5>Fax #: </h5>"& Request.Form("fax") &"<h5>Category Selected: </h5>"& Request.Form("category") &"<h5>Request or Comment: </h5>"& Request.Form("message")
mail.Send()
Response.Write("Your request or comment has been sent! Your message was: ")
Response.Write(Request.Form("messages"))
'Destroy the mail object!
Set mail = nothing
%>
<%
Dim objMessage
Set objMessage = Server.CreateObject("CDO.Message")
With objMessage
' Set message attributes
.To = Request.Form("email")
.From = "Gene Clark<
gclarkox@direcway.com>"
.Subject = "Thank you from Battin's Lawn Service"
'.TextBody = "This email should have an attachment attached!"
.CreateMHTMLBody "
file://c:/inetpub/wwwroot/flyer.html"
' Attachment using known static physical path
'.AddAttachment "c:\somepath\somefile.txt"
' Attachment using mappath to find the physical path
'.AddAttachment Server.MapPath("xxx.gif")
' Attachment added directly from a URL
'.AddAttachment "
http://xxx.gif"
' Send messages.
.Send
End With
Set objMessage = Nothing
%>
The output to the email message is:
, This is the message that is input into the textarea from the html form.
Thank you so much for your review, comments and time.