[Mono-list] Smtp status

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


Hi!

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=
=2E
> You may like to have a look at my implementation [1].
 =20
 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".
     =20
       changed and commited now .. thnx :)
        unknown/unknown   was the only thing i knew/knew
     =20
>
>     * SmtpStream::WriteBase64(Stream) [line 207] - IMO, you are looking=
 for
> "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=
hort
> 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=
lock=20
i just print the rest.  This works ok.. but i have seen that the end of f=
iles=20
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=
m=20
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=
host".
> This is what the MS docs read.
       =20
Yes thats right.. changed that in my first mail to the list with the sour=
ce=20
code files but forgot to change it now that i got CVS .. will change it n=
ow=20
=2E. thnx :)

  =20
>     * 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.
  =20
      You are right here.. I have to fix this.   I have only written:
      SmtpStream,SmtpClient,SmtpException,SmtpResponse
  so i have not had the time to look into the other classes yet. but i in=
tend=20
to.

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

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

 =20

Best regards=20
=09Per