HELP: SMTP SmtpMail How do I set a username and password?

Discussion in 'ASP .Net' started by T.Archer, Jan 20, 2005.

  1. T.Archer

    T.Archer Guest

    The host a client wants to use requires authentication to relay messages.

    How do I set the authentication (username/password) before using the
    smtpmail.send(mailmessage) method?

    Surely this must be a common thing to do. I have been utterly unable to
    google an answer.

    --Tony Archer
     
    T.Archer, Jan 20, 2005
    #1
    1. Advertising

  2. Re: SMTP SmtpMail How do I set a username and password?

    The mail functionality that the System.Web.Mail class represents doesn't
    have authenticated SMTP mail capabilities. You'll need to find another
    compoennt in order to send an SMTP server that requires authentication.
    Tgere are lots of free ones out there though so that's not a big problem.
    There's an open-source SMTP project at:
    http://sourceforge.net/projects/opensmtp-net/ that may work nicely.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - FrontPage

    "T.Archer" <tarcher @t beyondwebsites d0t com> wrote in message
    news:eEchXfq$...
    > The host a client wants to use requires authentication to relay messages.
    >
    > How do I set the authentication (username/password) before using the
    > smtpmail.send(mailmessage) method?
    >
    > Surely this must be a common thing to do. I have been utterly unable to
    > google an answer.
    >
    > --Tony Archer
    >
     
    Mark Fitzpatrick, Jan 20, 2005
    #2
    1. Advertising

  3. T.Archer

    MWells Guest

    Re: SMTP SmtpMail How do I set a username and password?

    Actually, I believe that there is a way, but you have to specify the headers
    manually.

    For an example, see;
    http://www.paulsadowski.com/WSH/cdo.htm

    '==This section provides the configuration information for the remote SMTP
    server.

    'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
    cdoBasic

    'Your UserID on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") =
    "youruserid"

    'Your password on the SMTP server
    objMessage.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
    "yourpassword"


    However, Mark's recommendation is best; there are a number of solid
    ..NET-specific email components out there with fantastic capabilities.
    You'll probably be better off avoiding CDO.

    /// M




    "Mark Fitzpatrick" <> wrote in message
    news:uYZ7OAr$...
    > The mail functionality that the System.Web.Mail class represents doesn't
    > have authenticated SMTP mail capabilities. You'll need to find another
    > compoennt in order to send an SMTP server that requires authentication.
    > Tgere are lots of free ones out there though so that's not a big problem.
    > There's an open-source SMTP project at:
    > http://sourceforge.net/projects/opensmtp-net/ that may work nicely.
    >
    > Hope this helps,
    > Mark Fitzpatrick
    > Microsoft MVP - FrontPage
    >
    > "T.Archer" <tarcher @t beyondwebsites d0t com> wrote in message
    > news:eEchXfq$...
    > > The host a client wants to use requires authentication to relay

    messages.
    > >
    > > How do I set the authentication (username/password) before using the
    > > smtpmail.send(mailmessage) method?
    > >
    > > Surely this must be a common thing to do. I have been utterly unable to
    > > google an answer.
    > >
    > > --Tony Archer
    > >

    >
    >
     
    MWells, Jan 20, 2005
    #3
    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. AAaron123
    Replies:
    2
    Views:
    2,186
    AAaron123
    Jan 16, 2009
  2. Andrew Jocelyn
    Replies:
    0
    Views:
    673
    Andrew Jocelyn
    Nov 29, 2008
  3. Andrew Jocelyn
    Replies:
    1
    Views:
    2,922
    Steven Cheng
    Dec 3, 2008
  4. Replies:
    0
    Views:
    638
  5. Bob
    Replies:
    2
    Views:
    261
Loading...

Share This Page