By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,394 Members | 1,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,394 IT Pros & Developers. It's quick & easy.

email body contains bad characters

P: n/a
I have created a side application in VB.NET which reads
rows from a DB and builds an email message.

when i have a long string the the mailmessage.body or the
mailmessage, it puts in an "!<linefeed><space>" at about
every 980th space. I have confirmed that these characters
are not in the string or the message body before the email
is sent. Has anyone seen this or have any thoughts?

Thanks
Mike
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Mike,

I can not reproduce the problem, when I test to send a string from a txt
file about 40kb.

1.You may try to send the mail via another smtp server to see if the
problem persists.
2. You may try to send a string which is not retrieve from the DB, e.g. you
may get it from a txt file, to see if the problem persists.
if yes, I hope you can post the code and the test txt file which will
become the mail.body for me to reproduce the problem on my machine.
3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107789
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which reads
rows from a DB and builds an email message.

when i have a long string the the mailmessage.body or the
mailmessage, it puts in an "!<linefeed><space>" at about
every 980th space. I have confirmed that these characters
are not in the string or the message body before the email
is sent. Has anyone seen this or have any thoughts?

Thanks
Mike


Jul 21 '05 #2

P: n/a
Hi Peter, thanks for the quick reply and the suggestions.
I tried using a hard coded string and a different web
server and still recveived the same results. However i
stumbled on a solution to the problem by adding a VbCrLf
to the end of the line. Let me give you a bit of backgroud
on what i am doing here:

This app will read rows from a table which represent
individual items. There may be more than one row per
email. This application, a windows service built in VB,
takes the SQLDataReader and reads every in a While
Datareader.Read loop. In each iteration, a MailMessage
object is created with a header and individual line
representing the data. It then attempts to add this
mailmessage to a hash, using a key based on the email
address. If it fails the add because it already exist in
the hash, we take the datastring and append it to the end
of the mailmessage.body of the existing item in the hash.

previously we only had one CrLf at the end of the add to
the body of the message. but now when i put in another
crlf at the end of the string itself, it seems to work.

Sorry for the long-winded explanation. I would like you to
see the code, but i will have to email it to you: i cant
post this material to a newsgroup.

thanks
Mike

-----Original Message-----
Hi Mike,

I can not reproduce the problem, when I test to send a string from a txtfile about 40kb.

1.You may try to send the mail via another smtp server to see if theproblem persists.
2. You may try to send a string which is not retrieve from the DB, e.g. youmay get it from a txt file, to see if the problem persists.if yes, I hope you can post the code and the test txt file which willbecome the mail.body for me to reproduce the problem on my machine.3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107789NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which reads
rows from a DB and builds an email message.

when i have a long string the the mailmessage.body or themailmessage, it puts in an "!<linefeed><space>" at about
every 980th space. I have confirmed that these charactersare not in the string or the message body before the emailis sent. Has anyone seen this or have any thoughts?

Thanks
Mike


.

Jul 21 '05 #3

P: n/a
SMTP has a defined limit of 76 characters per line. Some mail
servers/gateways will not accept your mail if this line length is not
enforced. If you want your e-mail to look better you should add your own
breaks when creating the text this will make sure the breaks are on the
correct lines. Another option is to use quoted-printable encoding which
will break the lines for you.

Feel free to see:
http://www.freesmtp.net
"Mike" <mi************@linedata.com> wrote in message
news:0c****************************@phx.gbl...
Hi Peter, thanks for the quick reply and the suggestions.
I tried using a hard coded string and a different web
server and still recveived the same results. However i
stumbled on a solution to the problem by adding a VbCrLf
to the end of the line. Let me give you a bit of backgroud
on what i am doing here:

This app will read rows from a table which represent
individual items. There may be more than one row per
email. This application, a windows service built in VB,
takes the SQLDataReader and reads every in a While
Datareader.Read loop. In each iteration, a MailMessage
object is created with a header and individual line
representing the data. It then attempts to add this
mailmessage to a hash, using a key based on the email
address. If it fails the add because it already exist in
the hash, we take the datastring and append it to the end
of the mailmessage.body of the existing item in the hash.

previously we only had one CrLf at the end of the add to
the body of the message. but now when i put in another
crlf at the end of the string itself, it seems to work.

Sorry for the long-winded explanation. I would like you to
see the code, but i will have to email it to you: i cant
post this material to a newsgroup.

thanks
Mike

-----Original Message-----
Hi Mike,

I can not reproduce the problem, when I test to send a

string from a txt
file about 40kb.

1.You may try to send the mail via another smtp server to

see if the
problem persists.
2. You may try to send a string which is not retrieve

from the DB, e.g. you
may get it from a txt file, to see if the problem

persists.
if yes, I hope you can post the code and the test txt

file which will
become the mail.body for me to reproduce the problem on

my machine.
3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107789NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which reads
rows from a DB and builds an email message.

when i have a long string the the mailmessage.body or themailmessage, it puts in an "!<linefeed><space>" at about
every 980th space. I have confirmed that these charactersare not in the string or the message body before the emailis sent. Has anyone seen this or have any thoughts?

Thanks
Mike


.

Jul 21 '05 #4

P: n/a
Hi Mike,

I agree with Bill's suggestion. So that I suggest you change another smtp
server.
If you want to email to me, you may email to my email address with the
"online" omitted.

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Mike" <mi************@linedata.com>
Sender: "Mike" <mi************@linedata.com>
References: <56****************************@phx.gbl> <kH**************@cpmsftngxa06.phx.gbl>Subject: RE: email body contains bad characters
Date: Wed, 10 Sep 2003 05:42:40 -0700
Lines: 101
Message-ID: <0c****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN3mQXECbRgzfmxThykjnjzUL1n1Q==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107927
NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general

Hi Peter, thanks for the quick reply and the suggestions.
I tried using a hard coded string and a different web
server and still recveived the same results. However i
stumbled on a solution to the problem by adding a VbCrLf
to the end of the line. Let me give you a bit of backgroud
on what i am doing here:

This app will read rows from a table which represent
individual items. There may be more than one row per
email. This application, a windows service built in VB,
takes the SQLDataReader and reads every in a While
Datareader.Read loop. In each iteration, a MailMessage
object is created with a header and individual line
representing the data. It then attempts to add this
mailmessage to a hash, using a key based on the email
address. If it fails the add because it already exist in
the hash, we take the datastring and append it to the end
of the mailmessage.body of the existing item in the hash.

previously we only had one CrLf at the end of the add to
the body of the message. but now when i put in another
crlf at the end of the string itself, it seems to work.

Sorry for the long-winded explanation. I would like you to
see the code, but i will have to email it to you: i cant
post this material to a newsgroup.

thanks
Mike

-----Original Message-----
Hi Mike,

I can not reproduce the problem, when I test to send a

string from a txt
file about 40kb.

1.You may try to send the mail via another smtp server to

see if the
problem persists.
2. You may try to send a string which is not retrieve

from the DB, e.g. you
may get it from a txt file, to see if the problem

persists.
if yes, I hope you can post the code and the test txt

file which will
become the mail.body for me to reproduce the problem on

my machine.
3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gblmicrosoft.public.dotnet.general:107789NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which reads
rows from a DB and builds an email message.

when i have a long string the the mailmessage.body orthemailmessage, it puts in an "!<linefeed><space>" at about
every 980th space. I have confirmed that thesecharactersare not in the string or the message body before theemailis sent. Has anyone seen this or have any thoughts?

Thanks
Mike


.


Jul 21 '05 #5

P: n/a
I think it did have something to do with the 76 characters
per line limit. I was inserting my own line breaks, but
somewhere around the 85th character.

Thanks to everyone who helped out with this one.

Mike
-----Original Message-----
Hi Mike,

I agree with Bill's suggestion. So that I suggest you change another smtpserver.
If you want to email to me, you may email to my email address with the"online" omitted.

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Mike" <mi************@linedata.com>
Sender: "Mike" <mi************@linedata.com>
References: <56****************************@phx.gbl>

<kH**************@cpmsftngxa06.phx.gbl>
Subject: RE: email body contains bad characters
Date: Wed, 10 Sep 2003 05:42:40 -0700
Lines: 101
Message-ID: <0c****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN3mQXECbRgzfmxThykjnjzUL1n1Q==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107927NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general

Hi Peter, thanks for the quick reply and the suggestions.I tried using a hard coded string and a different web
server and still recveived the same results. However i
stumbled on a solution to the problem by adding a VbCrLf
to the end of the line. Let me give you a bit of backgroudon what i am doing here:

This app will read rows from a table which represent
individual items. There may be more than one row per
email. This application, a windows service built in VB,
takes the SQLDataReader and reads every in a While
Datareader.Read loop. In each iteration, a MailMessage
object is created with a header and individual line
representing the data. It then attempts to add this
mailmessage to a hash, using a key based on the email
address. If it fails the add because it already exist in
the hash, we take the datastring and append it to the endof the mailmessage.body of the existing item in the hash.
previously we only had one CrLf at the end of the add to
the body of the message. but now when i put in another
crlf at the end of the string itself, it seems to work.

Sorry for the long-winded explanation. I would like you tosee the code, but i will have to email it to you: i cant
post this material to a newsgroup.

thanks
Mike

-----Original Message-----
Hi Mike,

I can not reproduce the problem, when I test to send a

string from a txt
file about 40kb.

1.You may try to send the mail via another smtp server to
see if the
problem persists.
2. You may try to send a string which is not retrieve

from the DB, e.g. you
may get it from a txt file, to see if the problem

persists.
if yes, I hope you can post the code and the test txt

file which will
become the mail.body for me to reproduce the problem on

my machine.
3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE

V5.50.4910.0300Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.general:107789
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which readsrows from a DB and builds an email message.

when i have a long string the the mailmessage.body or

the
mailmessage, it puts in an "!<linefeed><space>" at aboutevery 980th space. I have confirmed that these

characters
are not in the string or the message body before the

email
is sent. Has anyone seen this or have any thoughts?

Thanks
Mike
.


.

Jul 21 '05 #6

P: n/a
I think it did have something to do with the 76 characters
per line limit. I was inserting my own line breaks, but
somewhere around the 85th character.

Thanks to everyone who helped out with this one.

Mike
-----Original Message-----
Hi Mike,

I agree with Bill's suggestion. So that I suggest you change another smtpserver.
If you want to email to me, you may email to my email address with the"online" omitted.

I look forward to hearing from you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Mike" <mi************@linedata.com>
Sender: "Mike" <mi************@linedata.com>
References: <56****************************@phx.gbl>

<kH**************@cpmsftngxa06.phx.gbl>
Subject: RE: email body contains bad characters
Date: Wed, 10 Sep 2003 05:42:40 -0700
Lines: 101
Message-ID: <0c****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN3mQXECbRgzfmxThykjnjzUL1n1Q==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107927NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general

Hi Peter, thanks for the quick reply and the suggestions.I tried using a hard coded string and a different web
server and still recveived the same results. However i
stumbled on a solution to the problem by adding a VbCrLf
to the end of the line. Let me give you a bit of backgroudon what i am doing here:

This app will read rows from a table which represent
individual items. There may be more than one row per
email. This application, a windows service built in VB,
takes the SQLDataReader and reads every in a While
Datareader.Read loop. In each iteration, a MailMessage
object is created with a header and individual line
representing the data. It then attempts to add this
mailmessage to a hash, using a key based on the email
address. If it fails the add because it already exist in
the hash, we take the datastring and append it to the endof the mailmessage.body of the existing item in the hash.
previously we only had one CrLf at the end of the add to
the body of the message. but now when i put in another
crlf at the end of the string itself, it seems to work.

Sorry for the long-winded explanation. I would like you tosee the code, but i will have to email it to you: i cant
post this material to a newsgroup.

thanks
Mike

-----Original Message-----
Hi Mike,

I can not reproduce the problem, when I test to send a

string from a txt
file about 40kb.

1.You may try to send the mail via another smtp server to
see if the
problem persists.
2. You may try to send a string which is not retrieve

from the DB, e.g. you
may get it from a txt file, to see if the problem

persists.
if yes, I hope you can post the code and the test txt

file which will
become the mail.body for me to reproduce the problem on

my machine.
3. What Mail client did you use?

I will appreciate your effort.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and

confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "mike" <mi************@linedata.com>
Sender: "mike" <mi************@linedata.com>
Subject: email body contains bad characters
Date: Tue, 9 Sep 2003 07:59:16 -0700
Lines: 11
Message-ID: <56****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE

V5.50.4910.0300Thread-Index: AcN24vCRbEaUVCSkTFi7S5KYVpNGyA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.general:107789
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general

I have created a side application in VB.NET which readsrows from a DB and builds an email message.

when i have a long string the the mailmessage.body or

the
mailmessage, it puts in an "!<linefeed><space>" at aboutevery 980th space. I have confirmed that these

characters
are not in the string or the message body before the

email
is sent. Has anyone seen this or have any thoughts?

Thanks
Mike
.


.

Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.