homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

Mail Quirk with CDO/CDONTS

 3:08 pm on Mar 19, 2007 (gmt 0)

I have noticed from time to time that e-mail messages I receive from html forms display differently.

My asp page gathers the data for the body of the e-mail as follows:

txtBody = txtBody & "Form data posted" & vbcrlf &_
"First Name: " & Request.Form("txtFirstName") & vbcrlf &_
"Last Name: " & Request.Form("txtLastName") & vbcrlf

When I receive the e-mail, parts of it will be displayed as expected:

Form data posted
First Name: Andrew
Last Name: Smith

However, fields that are gathered in the same way as the code above will also display as following:

Form data posted
First Name: Andrew Last Name: Smith.

Certain fields will not wrap while others wrap without issue. But the code is the same for all fields.

If I add an additional vbcrlf, then I get two returns...

Has anyone experienced this? Does anyone know what would cause this?

Thanks in advance.



 7:33 am on Mar 28, 2007 (gmt 0)

That's weird. Did you ever figure out what was causing that? Text vs. html? Strange that it would do that.


 2:48 am on Mar 29, 2007 (gmt 0)

Are you using Outlook to read emails? Often times outlook 2003(?) and above will remove what it deems to be extraneous linefeeds. Don't ask me how it determines that because in identical forms, sometimes it will and sometimes it won't do it.

If this is in Outlook, the top of the message has something you can click to add the "extraneous" linefeeds back into the mail. Look for that...


 12:46 am on Apr 1, 2007 (gmt 0)

I am not sure if this is the issue, but I notice that you have a &_ to concatenate your data, but it should be a & _ (with a space between them). It could be that it is not wrapping at all from that code, but then some code converted to a line feed when it does wrap.

Just my 2 cents.


 9:29 pm on Apr 5, 2007 (gmt 0)

Thanks everyone...

I am embarassed to admit it, but bmcgee was correct. Thanks bmcgee for the heads up. Outlook was stripping some line brakes, but not all line breaks. Perhaps that is why I missed it...

Thanks again.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved