[Mono-list] Smtp status

Gaurav Vaish gvaish@adobe.com
Wed, 26 Feb 2003 10:39:29 +0530


Hi Per,

    I had a look at your SmtpClient and other classes. Implementation looks
pretty fine - noting that there's no abstraction needed. Here are some of my
findings which you may like to look into:

    * SmtpClient::SendMultipartMail(MailMessage) [line 106] - boundary is a
constant / hardcoded string. Ideally you should generate it dynamically. You
may like to have a look at my implementation [1].
    * [line 138] - While adding attachments, the Content-Type is
"unknown/unknown". My opinion is that you should keep it as
"application/octet-stream". I haven't seen MS implementation, but it's using
CDOSYS - and IIRC, all unknown types are "a/o-s".

    * SmtpStream::WriteBase64(Stream) [line 207] - IMO, you are looking for
"if(row.Length >= 60)". I am not sure what you are doing and why. If you are
giving a break after 60 chars in mail, you should better do this:

    while(row.Length >= 60)
    {
        WriteLine(row.ToString().Substring(0, 60)); // unless there's short
cut available for this
        row.Remove(0, 60);
    }

    * SmtpMail [line 20] - Why is the mail server static?

    * SmtpMail - You should give default value to smtpServer = "localhost".
This is what the MS docs read.

    * MailMessage - BodyEncoding, BodyFormat, Priority: All should have a
default value. And while set-ing, you should check whether the value is a
valid value using System.Enum.IsDefined(typeof(<enum>, value)) before
assigning.


    Rest all looks pretty OK to me, at least now. Enjoy sending mails... :-)



Happy Hacking,
Gaurav
http://mastergaurav.virtualave.net/iitk
---------------------------------------


----- Original Message -----
From: "Per Arneng" <pt99par@student.bth.se>
To: <mono-list@ximian.com>
Sent: Wednesday, February 26, 2003 00:50
Subject: [Mono-list] Smtp status


Hi!

Just got a laptop which i installed windows and cygwin on. So now i can sit
back on my old linux puter and run testcases on bothe platforms at the
same time using ssh.. great!!!

Working on now:

* Test cases on .NET runtime System.Web.Mail to fill the
   holes of a poorly written documentation :)
   Im going to run the test cases on mono's System.Web.Mail
   later on to make sure everyhing is nice and compattible.

Todo:

* Implement UUEncoding and create separate classes
  for UU and Base64

* Test theese separate classes against the uuencode program
  $uuencode
  $uuencode --base64

* Charsets .. encodings...
   .NET runtime useses the Encoding class for MailMessage.BodyEncoding and
   encodes the body and subject with that. If BodyEncoding is UTF-8 it sends
   it as that. The .NET runtime figures out the current charset:
Content-Type: text/plain;
         charset="iso-8859-1"
  I would like to do that but dont know how really..  need some help here!!

So anyone who knows how to get the current charset are welcome to mail me
and any other suggestions tips and bugs :)

///Per
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list