[Mono-list] Smtp status

Per Arneng pt99par@student.bth.se
Wed, 26 Feb 2003 06:57:53 +0100


Thnx for the feedback! I give comments bellow:

>     * 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].
 This was just a quick hack to get it working. First i thought of
  using a hashcode. But i will gladly look at your implementation :)

>     * [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".
       changed and commited now .. thnx :)
        unknown/unknown   was the only thing i knew/knew
>     * SmtpStream::WriteBase64(Stream) [line 207] - IMO, you are looking=
> "if(row.Length =3D=3D 60)". I am not sure what you are doing and why. I=
f you
> are giving a break after 60 chars in mail, you should better do this:
>     while(row.Length >=3D 60)
>     {
>         WriteLine(row.ToString().Substring(0, 60)); // unless there's s=
> cut available for this
>         row.Remove(0, 60);
>     }

  I add string ( length=3D=3D3 ) on it each time so i know it will become=
 60 and=20
when it comes to 60 i write that line.  when there is a final transform b=
i just print the rest.  This works ok.. but i have seen that the end of f=
doesnt allways get as they should. I intend to lift this code out and mak=
e a=20
separate class for it together with a UUEncode class. Then i can test the=
better and diff the result with the uuencode [--base64] command.

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

       This is MS spec :(   SmtpServer and Send should be static

>     * SmtpMail - You should give default value to smtpServer =3D "local=
> This is what the MS docs read.
Yes thats right.. changed that in my first mail to the list with the sour=
code files but forgot to change it now that i got CVS .. will change it n=
=2E. thnx :)

>     * MailMessage - BodyEncoding, BodyFormat, Priority: All should have=
> default value. And while set-ing, you should check whether the value is=
> valid value using System.Enum.IsDefined(typeof(<enum>, value)) before
> assigning.
      You are right here.. I have to fix this.   I have only written:
  so i have not had the time to look into the other classes yet. but i in=

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

        Thnx...  :) Nice mail.. it was helpful... if you find more stuff =
hessitate to send a mail...=20


Best regards=20