473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1438
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ed Sutton | last post by:
How can I show the email client UI so the user can send the attachment to the desired recipient. I get an exception if I leave the MailMessage.To property blank. Is there any way to do this? I...
3
by: Renato Giron | last post by:
I am trying to use an aspx page to send email using the smtpMail class and my smtp server . When I click send but when I check my inbox no messages appear. The page doesn't give any errors. I doble...
3
by: JJBW | last post by:
Hi I am having a bit of a problem with SmtpMail. I have a bit of code that should send an email but when it is executed no email turns up. MailMessage mmNotify = new MailMessage(); ...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
5
by: Wayne Wengert | last post by:
I am trying to build an aspx page that will send customized emails to a list of email addresses (in a SQL Server table) where each email has a customized hyperlink. As part of the body of the...
3
by: aslantifosi | last post by:
hi all, My question is about that i use a smpt server which is running on a different machine from my webserver machine. And i can authenticate with a user and password. I use SmtpMail class. i...
1
by: B-Dog | last post by:
I've built a form that I want to use to email some of the information off it to a few users which will include a link to a folder on our network. I'm trying to send it in html format but when the...
3
by: Edwin G. Castro | last post by:
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...
5
by: senol | last post by:
UPLOAD bu class public static void ResimYükle(HtmlInputFile HtmlInput, string id,string Klasor,string KatID) { string path_file;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.