Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Need help with unwanted character in email send
Old 03-24-2006, 10:32 AM Need help with unwanted character in email send
Novice Talker

Posts: 7
Trades: 0
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.
GClarkOX is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-24-2006, 12:51 PM Re: Need help with unwanted character in email send
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Usually when you get something like that, it's because you have two fields named message. When this occurs, the data from each field is separated by a comma.

Maybe it's a hidden field or something.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-24-2006, 01:02 PM Re: Need help with unwanted character in email send
Novice Talker

Posts: 7
Trades: 0
Thanks for the hint...I'll look for that. Have a good one!

That was it...Thank you so much, I really appreciate the assistance.

Last edited by GClarkOX; 03-24-2006 at 02:13 PM..
GClarkOX is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 01:07 AM Re: Need help with unwanted character in email send
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Not a problem. Glad it worked!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Need help with unwanted character in email send
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16893 seconds with 12 queries