Professional Web Applications Themes

CDOSYS and smarthost - ASP Database

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 ...

  1. #1

    Default CDOSYS and smarthost

    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 Guest

  2. #2

    Default Re: CDOSYS and smarthost

    Can you show your code? If you are specifying a server but mail is going to
    the local folders, then you must be using cdoSendUsingPickup rather than
    cdoSendUsingPort. I'll guess that if you use [url]www.timbuktu_doesn't[/url]
    _exist.com it will still work, because CDO is ignoring the server name
    you're sending because your code is telling it to use the local mail
    folders.

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




    "Dune" <anonymousdiscussions.microsoft.com> wrote in message
    news:077d01c3d590$e2b3ffc0$a301280aphx.gbl...
    > 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] Guest

  3. #3

    Default CDOSYS and smarthost

    hmmm, sorry, posted in wrong place!!
    >-----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 Guest

  4. #4

    Default Re: CDOSYS and smarthost

    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 = "helpdeskquotable.co.nz"
    .Sender = "helpdeskquotable.co.nz"
    .Subject = "QVNZ - Reset Password"
    .TextBody = "This is a test email."
    .Send
    End With

    Set iMsg = Nothing
    Set iConf = Nothing

    >-----Original Message-----
    >Can you show your code? If you are specifying a server
    but mail is going to
    >the local folders, then you must be using
    cdoSendUsingPickup rather than
    >cdoSendUsingPort. I'll guess that if you use
    [url]www.timbuktu_doesn't[/url]
    >_exist.com it will still work, because CDO is ignoring
    the server name
    >you're sending because your code is telling it to use the
    local mail
    >folders.
    >
    >--
    >Aaron Bertrand
    >SQL Server MVP
    >[url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    >"Dune" <anonymousdiscussions.microsoft.com> wrote in
    message
    >news:077d01c3d590$e2b3ffc0$a301280aphx.gbl...
    >> 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 Guest

Similar Threads

  1. CDOSYS vs CDONTS
    By in forum ASP Components
    Replies: 3
    Last Post: April 13th, 11:24 PM
  2. CDOSYS NNTP
    By Roland Hall in forum ASP Components
    Replies: 12
    Last Post: April 9th, 09:18 AM
  3. CDOSYS URL namespace... Huh?
    By Brian Smither in forum ASP Components
    Replies: 2
    Last Post: January 5th, 07:49 PM
  4. cdosys.dll problem
    By ram in forum ASP.NET Security
    Replies: 0
    Last Post: August 18th, 03:21 PM
  5. exim to exim4 smarthost question
    By Paul Johnson in forum Debian
    Replies: 2
    Last Post: August 2nd, 12:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139