Click here to Skip to main content
15,896,606 members
Articles / Operating Systems / Windows

Exclamation character getting inserted in body of mail messages sent programmatically using CDO object.

Rate me:
Please Sign up or sign in to vote.
1.67/5 (12 votes)
15 Mar 2011CPOL 29.6K   18   1
Exclamation character getting inserted in body of mail messages sent programmatically using CDO object.

Introduction

Exclamation character getting inserted in body of mail messages sent programmatically using CDO object.

char1.jpg



Cause:
This is happening because RFC 2822 places limits on the number of characters in a line. According to section 2.1.1 of RFC 2822 (document attached), lines in a message MUST be a maximum of 998 characters excluding the CRLF. If the number of characters in a line exceeds the limit, exclamation mark followed by CRLF character gets inserted automatically in the message body.

Solution: While forming body text, if we append line feed character after every nth (n < 998) character or so, then this problem will get resolved. ‘Char(10)’ can be used in SQL 2000 stored procedures as a line feed character.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Norway Norway
Growing up with the world wide web, witnessing many bubbles and the rise of information technology to becoming an indispensable part of human existence, I was intrigued and astonished by the drastic changes it brought to the way we lived then. I was drawn into this whirlpool of internet and technology as an enthusiast only to come out as a qualified software professional. Worked extensively on technologies, starting with Visual Basic, ASP, Oracle and MS SQL to WCF, .NET Core , Azure service fabric and Kubernetes. Architected applications for on-premises to hybrid clouds to cloud native environments.
Fortunately, I like what I do and work has been fulfilling.
It has been 20+ years of working for various organisations in several roles both technical and managerial but not a
dull day.

Comments and Discussions

 
GeneralHelpful Pin
santosh poojari25-Aug-08 23:10
santosh poojari25-Aug-08 23:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.