469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

SmtpMail delivers incomplete body

I'm using the System.Web.Mail.SmtpMail class to send email from an app
I wrote. I needed to install IIS to get it to send the messages even
though I wanted to use an existing SMTP server. Anyway, I got it to
send messages for me which is great.... Unfortunately, I do not
receive the complete contents of the Body. I have ran a few tests to
see what the Body contained before and after the SmtpMail.Send() call
and they matched. Something down the line messed it up so that only
part of the message is delivered. Any help would be very much
appreciated! Thanks!
Jul 21 '05 #1
3 1347
Post you code. I have done this with no problems.

"Edwin G. Castro" <ec*****@hp.com> wrote in message
news:d9**************************@posting.google.c om...
I'm using the System.Web.Mail.SmtpMail class to send email from an app
I wrote. I needed to install IIS to get it to send the messages even
though I wanted to use an existing SMTP server. Anyway, I got it to
send messages for me which is great.... Unfortunately, I do not
receive the complete contents of the Body. I have ran a few tests to
see what the Body contained before and after the SmtpMail.Send() call
and they matched. Something down the line messed it up so that only
part of the message is delivered. Any help would be very much
appreciated! Thanks!

Jul 21 '05 #2
ec*****@hp.com (Edwin G. Castro) wrote in message news:<d9**************************@posting.google. com>...
I'm using the System.Web.Mail.SmtpMail class to send email from an app
I wrote. I needed to install IIS to get it to send the messages even
though I wanted to use an existing SMTP server. Anyway, I got it to
send messages for me which is great.... Unfortunately, I do not
receive the complete contents of the Body. I have ran a few tests to
see what the Body contained before and after the SmtpMail.Send() call
and they matched. Something down the line messed it up so that only
part of the message is delivered. Any help would be very much
appreciated! Thanks!


I ran a few more tests and I discovered that when I write the body
contents to a file (body.html) that all the contents are there as
expected. If I open the file (body.html) in Visual Studio .NET I get
some interesting results. The first result is that when I first view
the file in Design mode I see all the contents as expected. When I
switch to HTML mode Visual Studio .NET automaticaly formats the file
and I loose the end of the file just like when I receive the messages
through email. If I swith back to Design mode after the file has been
formated then I can't see the end of the file.

It looks like .NET is performing a similar kind of formatting since
the result is exactly the same.
Jul 21 '05 #3
ec*****@hp.com (Edwin G. Castro) wrote in message news:<d9**************************@posting.google. com>...
I'm using the System.Web.Mail.SmtpMail class to send email from an app
I wrote. I needed to install IIS to get it to send the messages even
though I wanted to use an existing SMTP server. Anyway, I got it to
send messages for me which is great.... Unfortunately, I do not
receive the complete contents of the Body. I have ran a few tests to
see what the Body contained before and after the SmtpMail.Send() call
and they matched. Something down the line messed it up so that only
part of the message is delivered. Any help would be very much
appreciated! Thanks!


I determined the cause of the problem.

The file I was reading to generate my email from contained '\x0'
characters. Microsoft tools generate the file and I was not aware of
that. In any case, those characters were causing SmtpMail to think the
end of the body had arrived. I added a simple call to
string.Trim('\x0') to remove the offending characters and the problem
is now solved!
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Renato Giron | last post: by
3 posts views Thread by JJBW | last post: by
5 posts views Thread by ElanKathir | last post: by
5 posts views Thread by Wayne Wengert | last post: by
3 posts views Thread by aslantifosi | last post: by
1 post views Thread by B-Dog | last post: by
3 posts views Thread by Edwin G. Castro | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.