CDOSYS and smarthost

Discussion in 'ASP General' started by Dune, Jan 8, 2004.

  1. Dune

    Dune Guest

    I'm trying to send an email from my ASP page using
    CDO.Message and CDO.Configuration. I couldn't get this to
    work for ages and all my emails ended up in
    inetpub\mailroot\queue.

    I'm behind a firewall and finally figured out that i have
    to set the smarthost field for the SMTP Virtual Server in
    IIS to get any emails to send. All good, the emails get
    sent.

    The part that confuses me is that in my code, no matter
    what i set the cdoSMTPServer field for the
    CDO.Configuration object to, it always works. I guess it's
    using the smarthost field in the SMTP Virtual Server to
    get the name of the server to use...but how will this all
    work out on a different computer??

    (What i would really like is for the code to use the
    server specified in the cdoSMTPServer field instead of
    relying on the configuration of the SMTP Virtual Server.)

    Cheers.
     
    Dune, Jan 8, 2004
    #1
    1. Advertising

  2. Hmm, sorry, I answered in the wrong place.

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Dune" <> wrote in message
    news:089301c3d592$7c0093e0$...
    > I'm trying to send an email from my ASP page using
    > CDO.Message and CDO.Configuration. I couldn't get this to
    > work for ages and all my emails ended up in
    > inetpub\mailroot\queue.
    >
    > I'm behind a firewall and finally figured out that i have
    > to set the smarthost field for the SMTP Virtual Server in
    > IIS to get any emails to send. All good, the emails get
    > sent.
    >
    > The part that confuses me is that in my code, no matter
    > what i set the cdoSMTPServer field for the
    > CDO.Configuration object to, it always works. I guess it's
    > using the smarthost field in the SMTP Virtual Server to
    > get the name of the server to use...but how will this all
    > work out on a different computer??
    >
    > (What i would really like is for the code to use the
    > server specified in the cdoSMTPServer field instead of
    > relying on the configuration of the SMTP Virtual Server.)
    >
    > Cheers.
     
    Aaron Bertrand [MVP], Jan 8, 2004
    #2
    1. Advertising

  3. Dune

    Dune Guest

    here's my code:

    Dim iMsg
    Set iMsg = Server.CreateObject("CDO.Message")

    Dim iConf
    Set iConf = Server.CreateObject("CDO.Configuration")

    Dim Flds
    Set Flds = iConf.Fields
    Flds("cdoSendUsingMethod") = 2 'cdoSendUsingPort
    ' this is actually set to the server name in my code
    Flds("cdoSMTPServer") = "smarthostServerName"
    Flds("cdoSMTPServerPort") = 25
    Flds("cdoSMTPAuthenticate") = 0 'cdoAnonymous
    Flds.Update

    With iMsg
    Set .Configuration = iConf
    .To = Request.Form("txtEmail")
    .From = ""
    .Sender = ""
    .Subject = "QVNZ - Reset Password"
    .TextBody = "This is a test email."
    .Send
    End With

    Set iMsg = Nothing
    Set iConf = Nothing


    >-----Original Message-----
    >I'm trying to send an email from my ASP page using
    >CDO.Message and CDO.Configuration. I couldn't get this to
    >work for ages and all my emails ended up in
    >inetpub\mailroot\queue.
    >
    >I'm behind a firewall and finally figured out that i have
    >to set the smarthost field for the SMTP Virtual Server in
    >IIS to get any emails to send. All good, the emails get
    >sent.
    >
    >The part that confuses me is that in my code, no matter
    >what i set the cdoSMTPServer field for the
    >CDO.Configuration object to, it always works. I guess

    it's
    >using the smarthost field in the SMTP Virtual Server to
    >get the name of the server to use...but how will this all
    >work out on a different computer??
    >
    >(What i would really like is for the code to use the
    >server specified in the cdoSMTPServer field instead of
    >relying on the configuration of the SMTP Virtual Server.)
    >
    >Cheers.
    >.
    >
     
    Dune, Jan 8, 2004
    #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. martin

    cdosys.dll and sending mail

    martin, Jul 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,158
    wolfgangiron
    Jan 4, 2012
  2. BB
    Replies:
    2
    Views:
    137
  3. Douglas

    CDOSYS and Japanese

    Douglas, Nov 25, 2003, in forum: ASP General
    Replies:
    0
    Views:
    128
    Douglas
    Nov 25, 2003
  4. tshad

    CDOSYS AND CDONTS on W2K3 machine

    tshad, Jan 14, 2005, in forum: ASP General
    Replies:
    15
    Views:
    261
    tshad
    Jan 18, 2005
  5. Bennett
    Replies:
    1
    Views:
    153
    Adam Funk
    Jun 1, 2007
Loading...

Share This Page