email body contains bad characters

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

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
 
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.

--------------------
 
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
 
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
 
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.

--------------------
 
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
 
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
 
Back
Top