473,895 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subject text length limit in system.net.mail ?

Is anyone aware of a size limit imposed on the subject text when using the
System.Net.Mail library?

I'm getting problems of message not being recieved if the subject exceeds 15
chars.

Thx
Jun 18 '07 #1
4 8474
Hello Alec,

I assume that it is the mail server limitation, because the Subject in System.Net
get the string type and doesn't trim it

Relation the standard, below, there is no 15 chars limitation for the subject

"RFC 2822 ("Internet Message Format")"
2.1.1. Line Length Limits
There are two limits that this standard places on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.

The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that
simply cannot handle more than 998 characters on a line. Receiving
implementations would do well to handle an arbitrarily large number
of characters in a line for robustness sake. However, there are so
many implementations which (in compliance with the transport
requirements of [RFC2821]) do not accept messages containing more
than 1000 character including the CR and LF per line, it is important
for implementations not to create such messages.

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AMIs anyone aware of a size limit imposed on the subject text when
AMusing the System.Net.Mail library?
AM>
AMI'm getting problems of message not being recieved if the subject
AMexceeds 15 chars.
AM>
AMThx
AM>
Jun 18 '07 #2
Thanks for that info Michael.

Ok. It must be something else then.

I'm using Exchange Server 2003 and am aware that subject lines can normally
be much longer than 15 chars.

What I'm trying to do is send a batch of marketing messages (HTML format)
from our CRM database. The HTML of the body, plus the subject line and the
list of recipient email addresses all come from the SQL db.

By doing a lot of trial-and-error testing yesterday I found that I had to
either reduce the HTML in size such that it was going to be useless
(literally no more than a bare minimum valid doc with a single "hello"
paragraph), or reduce the subject text to 15 chars or less.

While going over those limits does not cause an exception, the message just
seems to vanish into the ether - not even being present in the Exchange log
file.

I have wondered if this is partly due to the Symantec AV client
(Corp/Enterprise ver 10.1). This certainly introduces a lengthy 1.5 - 2
minute delay in the message being handled, but I cannot be certain if it is
stopping the messages altogether. I have tried stopping all the Symantec
services. This allows the messages to be delivered far more quickly (I'm
using my own address for testing), but it doesn't seem to prevent the larger
content variations from disappearing.

I'm at a real loss to know what's going on here. I have used Net.Mail very
successfully in other projects, but in those cases, the content of the
message had very little DB-sourced content (though there was interaction to
SQL in terms of lookups and saving of data).

Using the same project to test a "plain text" version of sending works every
time, so I have been checking the content of the DB stuff for invalid
characters that might cause the process to "stall", but as yet have not
found anything obvious.

The subject text is input via a simple Win-form textbox. The HTML content
is create using an HTML editor component based on the Nikhil Kothari
component. While it does introduce unwanted variations in the html source,
I don't think its anything that would cause such an issue.

Any further help would be deeply appreciated.

Regards,

Alec
"Michael Nemtsev" <ne*****@msn.co mwrote in message
news:a2******** *************** ****@msnews.mic rosoft.com...
Hello Alec,

I assume that it is the mail server limitation, because the Subject in
System.Net get the string type and doesn't trim it

Relation the standard, below, there is no 15 chars limitation for the
subject

"RFC 2822 ("Internet Message Format")"
2.1.1. Line Length Limits There are two limits that this standard places
on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.

The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that
simply cannot handle more than 998 characters on a line. Receiving
implementations would do well to handle an arbitrarily large number
of characters in a line for robustness sake. However, there are so
many implementations which (in compliance with the transport
requirements of [RFC2821]) do not accept messages containing more
than 1000 character including the CR and LF per line, it is important
for implementations not to create such messages.

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AMIs anyone aware of a size limit imposed on the subject text when
AMusing the System.Net.Mail library?
AMAMI'm getting problems of message not being recieved if the subject
AMexceeds 15 chars.
AMAMThx
AM>

Jun 19 '07 #3
Hello Alec,

Well.... I'm not the expert in Exchange server, suggest to refer this question
to the exchage group

I see the other problem in the approach you choose.
If u fix your issue and everything will be working fine, than what if the
client, who u ship the app, decided to change the mail server? You are not
assured with new mail server limitation

I'd suggest to review your architecture, and add feature to send the links
to pre-generated html pages published somewhere.
So, if client's mail server works wrong, you can switch on alternative way

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AMThanks for that info Michael.
AM>
AMOk. It must be something else then.
AM>
AMI'm using Exchange Server 2003 and am aware that subject lines can
AMnormally be much longer than 15 chars.
AM>
AMWhat I'm trying to do is send a batch of marketing messages (HTML
AMformat) from our CRM database. The HTML of the body, plus the
AMsubject line and the list of recipient email addresses all come from
AMthe SQL db.
AM>
AMBy doing a lot of trial-and-error testing yesterday I found that I
AMhad to either reduce the HTML in size such that it was going to be
AMuseless (literally no more than a bare minimum valid doc with a
AMsingle "hello" paragraph), or reduce the subject text to 15 chars or
AMless.
AM>
AMWhile going over those limits does not cause an exception, the
AMmessage just seems to vanish into the ether - not even being present
AMin the Exchange log file.
AM>
AMI have wondered if this is partly due to the Symantec AV client
AM(Corp/Enterprise ver 10.1). This certainly introduces a lengthy 1.5
AM- 2 minute delay in the message being handled, but I cannot be
AMcertain if it is stopping the messages altogether. I have tried
AMstopping all the Symantec services. This allows the messages to be
AMdelivered far more quickly (I'm using my own address for testing),
AMbut it doesn't seem to prevent the larger content variations from
AMdisappearing.
AM>
AMI'm at a real loss to know what's going on here. I have used
AMNet.Mail very successfully in other projects, but in those cases,
AMthe content of the message had very little DB-sourced content
AM(though there was interaction to SQL in terms of lookups and saving
AMof data).
AM>
AMUsing the same project to test a "plain text" version of sending
AMworks every time, so I have been checking the content of the DB
AMstuff for invalid characters that might cause the process to
AM"stall", but as yet have not found anything obvious.
AM>
AMThe subject text is input via a simple Win-form textbox. The HTML
AMcontent is create using an HTML editor component based on the Nikhil
AMKothari component. While it does introduce unwanted variations in
AMthe html source, I don't think its anything that would cause such an
AMissue.
AM>
AMAny further help would be deeply appreciated.
AM>
AMRegards,
AM>
AMAlec
AM>
AM"Michael Nemtsev" <ne*****@msn.co mwrote in message
AMnews:a2****** *************** ******@msnews.m icrosoft.com...
AM>
>Hello Alec,

I assume that it is the mail server limitation, because the Subject
in System.Net get the string type and doesn't trim it

Relation the standard, below, there is no 15 chars limitation for the
subject

"RFC 2822 ("Internet Message Format")"
2.1.1. Line Length Limits There are two limits that this standard
places
on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.
The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that
simply cannot handle more than 998 characters on a line. Receiving
implementation s would do well to handle an arbitrarily large number
of characters in a line for robustness sake. However, there are so
many implementations which (in compliance with the transport
requirements of [RFC2821]) do not accept messages containing more
than 1000 character including the CR and LF per line, it is important
for implementations not to create such messages.

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

AMIs anyone aware of a size limit imposed on the subject text when
AMusing the System.Net.Mail library?
AMAMI'm getting problems of message not being recieved if the
subject
AMexceeds 15 chars.
AMAMThx
AM>

Jun 19 '07 #4
Finally figured what it was - Internet Message Filter for Exchange settings
were a little too protective. Had it on a setting of 5, but this seems to
be sinking any message that has long subject lines, or certain HTML tags,
such as "<pre>".

Al
"Michael Nemtsev" <ne*****@msn.co mwrote in message
news:a2******** *************** ****@msnews.mic rosoft.com...
Hello Alec,

Well.... I'm not the expert in Exchange server, suggest to refer this
question to the exchage group

I see the other problem in the approach you choose. If u fix your issue
and everything will be working fine, than what if the client, who u ship
the app, decided to change the mail server? You are not assured with new
mail server limitation

I'd suggest to review your architecture, and add feature to send the links
to pre-generated html pages published somewhere.
So, if client's mail server works wrong, you can switch on alternative way

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AMThanks for that info Michael.
AMAMOk. It must be something else then.
AMAMI'm using Exchange Server 2003 and am aware that subject lines can
AMnormally be much longer than 15 chars.
AMAMWhat I'm trying to do is send a batch of marketing messages (HTML
AMformat) from our CRM database. The HTML of the body, plus the
AMsubject line and the list of recipient email addresses all come from
AMthe SQL db.
AMAMBy doing a lot of trial-and-error testing yesterday I found that I
AMhad to either reduce the HTML in size such that it was going to be
AMuseless (literally no more than a bare minimum valid doc with a
AMsingle "hello" paragraph), or reduce the subject text to 15 chars or
AMless.
AMAMWhile going over those limits does not cause an exception, the
AMmessage just seems to vanish into the ether - not even being present
AMin the Exchange log file.
AMAMI have wondered if this is partly due to the Symantec AV client
AM(Corp/Enterprise ver 10.1). This certainly introduces a lengthy 1.5
AM- 2 minute delay in the message being handled, but I cannot be
AMcertain if it is stopping the messages altogether. I have tried
AMstopping all the Symantec services. This allows the messages to be
AMdelivered far more quickly (I'm using my own address for testing),
AMbut it doesn't seem to prevent the larger content variations from
AMdisappearing.
AMAMI'm at a real loss to know what's going on here. I have used
AMNet.Mail very successfully in other projects, but in those cases,
AMthe content of the message had very little DB-sourced content
AM(though there was interaction to SQL in terms of lookups and saving
AMof data).
AMAMUsing the same project to test a "plain text" version of sending
AMworks every time, so I have been checking the content of the DB
AMstuff for invalid characters that might cause the process to
AM"stall", but as yet have not found anything obvious.
AMAMThe subject text is input via a simple Win-form textbox. The HTML
AMcontent is create using an HTML editor component based on the Nikhil
AMKothari component. While it does introduce unwanted variations in
AMthe html source, I don't think its anything that would cause such an
AMissue.
AMAMAny further help would be deeply appreciated.
AMAMRegards,
AMAMAlec
AMAM"Michael Nemtsev" <ne*****@msn.co mwrote in message
AMnews:a2****** *************** ******@msnews.m icrosoft.com...
AM>
>>Hello Alec,

I assume that it is the mail server limitation, because the Subject
in System.Net get the string type and doesn't trim it

Relation the standard, below, there is no 15 chars limitation for the
subject

"RFC 2822 ("Internet Message Format")"
2.1.1. Line Length Limits There are two limits that this standard
places
on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.
The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that
simply cannot handle more than 998 characters on a line. Receiving
implementatio ns would do well to handle an arbitrarily large number
of characters in a line for robustness sake. However, there are so
many implementations which (in compliance with the transport
requirement s of [RFC2821]) do not accept messages containing more
than 1000 character including the CR and LF per line, it is important
for implementations not to create such messages.

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangel o

AMIs anyone aware of a size limit imposed on the subject text when
AMusing the System.Net.Mail library?
AMAMI'm getting problems of message not being recieved if the
subject
AMexceeds 15 chars.
AMAMThx
AM>


Jun 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3644
by: Notlwonk | last post by:
I have written an event sink in C# that hooks into our Exchange Server 2000 store. The sink fires and the various LOG files are created, but for some reason I cannot seem to read-in the e-mail Subject or Message Body for the e-mail that triggers the Event Sink to run. What am I doing wrong? Thank you,
16
2424
by: Christine | last post by:
I was wondering if it is possible to read in a text file as a data type other than string. I would like to read it in as some type that handles numbers, like double, or float.
6
6534
by: Aaron Smith | last post by:
Is there a way to put a limit on the text size of a datagrid column? Thanks, Aaron -- --- Aaron Smith Remove -1- to E-Mail me. Spam Sucks.
5
5447
by: Daniel | last post by:
c# string size limit? length of string limit?
4
2969
by: Derty | last post by:
Any way to limit the length of databound text on a datalist itemtemplate?
3
8753
by: Laangen_LU | last post by:
Dear Group, my first post to this group, so if I'm on the wrong group, my apologies. I'm trying to send out an email in Chinese lanuage using the mail() function in PHP. Subject and mailbody are stored as Unicode entities (eg. 註)
11
5955
by: =?Utf-8?B?VmxhZCBIcnlib2s=?= | last post by:
Using IIS7, Vista x64, ASP.NET 2.0. I am getting HTTP 400 "Bad Request" for the following URL: /HTTPVPNWebPortal/62ccc22e-069b-441e-b9f0-83b45e7f4f1e/UdVpnSGFuZGxlcnMvQ292ZXJBcnQuYXNoeD9DJTNhJTVjRG9jdW1lbnRzK2FuZCtTZXR0aW5ncyU1Y011c2hyb29tJTVjTXkrRG9jdW1lbnRzJTVjTXkrTXVzaWMlNWNGcmVuY2glNWNBbWVpbGUlNWNZYW5uK1RpZXJzZW4rLStMYStOb3llZS5tcDM=/SecureTunnel.axd Here's what makes difference: - URL length: As soon as I make this URL two chars...
1
1671
by: Lilith | last post by:
I'm looking at practical string lengths and the capacity of a text box. I'm using a string to progressively add the status of a process periodically and dumping that text into a text box. I don't mind trimming the first x number of lines from the string when it reaches certain limits, but I'd like to know at what point I may be approaching an exception being thrown, an application crash or system memory getting consumed. If possible,...
3
1752
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got some code that is chopping my subject line on the messages I receive, and I do not know why. Our server is running Active Directory and SQL Server 2000 Enterprise. The email is sent, but all we see in the subject line is "S". Here is what I am doing: private bool SendMessage(string fcn)
0
9990
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11249
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10847
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9651
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7179
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4693
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4288
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.