MailMessage seems to break SMTP protocol

  • Thread starter Thread starter Andy Fish
  • Start date Start date
A

Andy Fish

Hi,

I have a .net (1.1) app that uses the MailMessage class to send email. I
have it connecting to the microsoft IIS SMTP Server on the local machine
which then actually sends the mail.

The problem is that when I send email to certain domains I get an error
reported in the SMTP log "see http://pobox.com/~djb/docs/smtplf.html". this
takes you to a web page talking about how you tried to send an email that
breaks the SMTP protocol by having LF without CR.

As you would expect, the documentation for the MailMessage class doesn't
mention what comprises a valid email body. However, presumably it would
either reject the text I have passed in or process it appropriately. Any
ideas what else could be going wrong?

TIA

Andy
 
FYI it was indeed down to a missing CR character in the message. However, I
think the blame can be shared equally between 4 parties in this case:

1. I shouldn't have tried to send a message with a line feed only in it
(although I could argue that I wasn't to know any better).

2. The MailMessage class should either have added a CR or should not have
accepted the message for delivery in the first place. At the very least it
should have documented the fact that the message body is passed on
unfiltered to the SMTP server

3. IIS6 SMTP server should not have accepted the message for delivery if it
fails to conform to the protocol.

4. Qmail (the receiving email server) should have rejected the message
properly rather than just closing the connection. It was only when I turned
the logging up to the highest level that I could actually see an error
message. In it's defence, this could be the way IIS handled and logged the
error though.

Right, that's my rant over with.

Andy
 
Hi all,

May i know how to configure QMail for IIS 5.1 windows xp sp2

i want to send email from ASP .net with validation of Email ID (From and To
Ids)..
any directions would be much helpful

regards
Rajaraman
 
Back
Top