Converting from System.Web.Mail to System.Net.Mail

Discussion in 'ASP .Net' started by Nathan Sokalski, Dec 12, 2006.

  1. I am moving an application that involves sending email from 1.1 to 2.0. I am
    attempting to convert the email-sending code from System.Web.Mail to
    System.Net.Mail. I think I have most of this accomplished, but I am trying
    to find the System.Net.Mail equivelant of
    System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
    following to specify whether the message was html or text:

    mymessage.BodyFormat = Mail.MailFormat.Html

    However, I cannot find a property of the System.Net.Mail.MailMessage class
    that specifies this. What do I do to specify html or text? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
    Nathan Sokalski, Dec 12, 2006
    #1
    1. Advertising

  2. Nathan Sokalski

    Jacob Guest

    I think you're supposed to use myMessage.IsBodyHtml = true;

    Nathan Sokalski wrote:
    > I am moving an application that involves sending email from 1.1 to 2.0. I am
    > attempting to convert the email-sending code from System.Web.Mail to
    > System.Net.Mail. I think I have most of this accomplished, but I am trying
    > to find the System.Net.Mail equivelant of
    > System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
    > following to specify whether the message was html or text:
    >
    > mymessage.BodyFormat = Mail.MailFormat.Html
    >
    > However, I cannot find a property of the System.Net.Mail.MailMessage class
    > that specifies this. What do I do to specify html or text? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    Jacob, Dec 12, 2006
    #2
    1. Advertising

  3. I think that System.Net.Mail is going to be depreciated in 3.0, the
    new syntax is going to be System.Net.Web.Net.Mail. Then a few months
    after that to break all compatibility it will be changed again to
    System.Net.NewMail. Then a couple of months later it will be changed
    again to System.Mail.Mailer.NewMail, just in case anyone got used to
    the old way.

    If you can hang on a year or two, then you can avoid all of these
    changes. As its quite likely that they will just kill the language and
    bring out a new completely different one.

    I heard from an insider that the next big thing is going to be called
    "DNA-Universe". They decided that everything they made is shite and we
    have all been doing things the wrong way - and to "unlearn everything".


    The Grand Master



    Nathan Sokalski wrote:
    > I am moving an application that involves sending email from 1.1 to 2.0. I am
    > attempting to convert the email-sending code from System.Web.Mail to
    > System.Net.Mail. I think I have most of this accomplished, but I am trying
    > to find the System.Net.Mail equivelant of
    > System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
    > following to specify whether the message was html or text:
    >
    > mymessage.BodyFormat = Mail.MailFormat.Html
    >
    > However, I cannot find a property of the System.Net.Mail.MailMessage class
    > that specifies this. What do I do to specify html or text? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    Master Programmer, Dec 12, 2006
    #3
  4. Nathan Sokalski

    Sugan Guest

    Can you stop repeating these annoying posts. If you are not interested
    in VB .Net, please leave the group. Why in this world you bother about
    other programmers?

    Master Programmer wrote:
    > I think that System.Net.Mail is going to be depreciated in 3.0, the
    > new syntax is going to be System.Net.Web.Net.Mail. Then a few months
    > after that to break all compatibility it will be changed again to
    > System.Net.NewMail. Then a couple of months later it will be changed
    > again to System.Mail.Mailer.NewMail, just in case anyone got used to
    > the old way.
    >
    > If you can hang on a year or two, then you can avoid all of these
    > changes. As its quite likely that they will just kill the language and
    > bring out a new completely different one.
    >
    > I heard from an insider that the next big thing is going to be called
    > "DNA-Universe". They decided that everything they made is shite and we
    > have all been doing things the wrong way - and to "unlearn everything".
    >
    >
    > The Grand Master
    >
    >
    >
    > Nathan Sokalski wrote:
    > > I am moving an application that involves sending email from 1.1 to 2.0. I am
    > > attempting to convert the email-sending code from System.Web.Mail to
    > > System.Net.Mail. I think I have most of this accomplished, but I am trying
    > > to find the System.Net.Mail equivelant of
    > > System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
    > > following to specify whether the message was html or text:
    > >
    > > mymessage.BodyFormat = Mail.MailFormat.Html
    > >
    > > However, I cannot find a property of the System.Net.Mail.MailMessage class
    > > that specifies this. What do I do to specify html or text? Thanks.
    > > --
    > > Nathan Sokalski
    > >
    > > http://www.nathansokalski.com/
    Sugan, Dec 12, 2006
    #4
  5. No, I most certainly will not. I will continue for as long as I choose.
    How dare you try to tell me what to do.

    The Grand Master


    Sugan wrote:
    > Can you stop repeating these annoying posts. If you are not interested
    > in VB .Net, please leave the group. Why in this world you bother about
    > other programmers?
    >
    > Master Programmer wrote:
    > > I think that System.Net.Mail is going to be depreciated in 3.0, the
    > > new syntax is going to be System.Net.Web.Net.Mail. Then a few months
    > > after that to break all compatibility it will be changed again to
    > > System.Net.NewMail. Then a couple of months later it will be changed
    > > again to System.Mail.Mailer.NewMail, just in case anyone got used to
    > > the old way.
    > >
    > > If you can hang on a year or two, then you can avoid all of these
    > > changes. As its quite likely that they will just kill the language and
    > > bring out a new completely different one.
    > >
    > > I heard from an insider that the next big thing is going to be called
    > > "DNA-Universe". They decided that everything they made is shite and we
    > > have all been doing things the wrong way - and to "unlearn everything".
    > >
    > >
    > > The Grand Master
    > >
    > >
    > >
    > > Nathan Sokalski wrote:
    > > > I am moving an application that involves sending email from 1.1 to 2.0. I am
    > > > attempting to convert the email-sending code from System.Web.Mail to
    > > > System.Net.Mail. I think I have most of this accomplished, but I am trying
    > > > to find the System.Net.Mail equivelant of
    > > > System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
    > > > following to specify whether the message was html or text:
    > > >
    > > > mymessage.BodyFormat = Mail.MailFormat.Html
    > > >
    > > > However, I cannot find a property of the System.Net.Mail.MailMessage class
    > > > that specifies this. What do I do to specify html or text? Thanks.
    > > > --
    > > > Nathan Sokalski
    > > >
    > > > http://www.nathansokalski.com/
    Master Programmer, Dec 12, 2006
    #5
  6. Nathan Sokalski

    Spam Catcher Guest

    "Sugan" <> wrote in news:1165918179.909134.177000@
    73g2000cwn.googlegroups.com:

    > Can you stop repeating these annoying posts. If you are not interested
    > in VB .Net, please leave the group. Why in this world you bother about
    > other programmers?


    He does have a point ... Remoting is another example.
    Spam Catcher, Dec 12, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. me
    Replies:
    0
    Views:
    421
  2. Replies:
    4
    Views:
    55,427
  3. Brad
    Replies:
    2
    Views:
    9,588
  4. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    System.Net.Mail vs System.Web.Mail

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Jun 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    10,570
    Walter Wang [MSFT]
    Jun 16, 2006
  5. Frank
    Replies:
    10
    Views:
    845
    Juan T. Llibre
    Mar 29, 2007
Loading...

Share This Page