CDONTS NewMail

Discussion in 'ASP General' started by Earl Partridge, Jun 7, 2008.

  1. If there's a newgroup for this subject, please point me to it...
    Is it possible to set the font size of the body of the text?
    Earl
     
    Earl Partridge, Jun 7, 2008
    #1
    1. Advertising

  2. "Earl Partridge" <> wrote in message
    news:...
    >If there's a newgroup for this subject, please point me to it...
    >Is it possible to set the font size of the body of the text?


    First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
    exampel of sending an
    email with CDOSYS:-

    Const cdoSendUsingMethod =
    "http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSMTPServer =
    "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPickupDirectory =
    "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    Const cdoSMTPServerPort =
    "http://schemas.microsoft.com/cdo/configuration/smtpserverport"

    Const cdoSendUsingPickup = 1
    Const cdoSendUsingPort = 2

    Dim oMsg : Set oMsg = CreateObject("CDO.Message")
    Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

    With oConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "mysmtp.myserver.com"
    .Item(cdoSMTPServerPort) = 25
    .Update
    End With

    oMsg.From = "Me <>"
    oMsg.To = "Bloke <>"
    oMsg.Subject = "Test"
    oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    World</body></html>"
    Set oMsg.Configuration = oConfig

    oMsg.Send


    Note the HTMLBody uses a style that defines the font size.

    Of course this assumes you aren't asking how to make the size of font in a
    plain text message the bigger. The answer to that would be; you can't use a
    HTMLBody instead.


    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 7, 2008
    #2
    1. Advertising

  3. Earl Partridge

    Old Pedant Guest

    A goof in that, Anthony:

    oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    World</body></html>"

    Ummm...that NEEDS to be

    oMsg.HTMLBody = "<html><body style=""font-size:14pt"">Hello
    World</body></html>"

    Doubled quotes to embed them, of course.


    "Anthony Jones" wrote:

    >
    > "Earl Partridge" <> wrote in message
    > news:...
    > >If there's a newgroup for this subject, please point me to it...
    > >Is it possible to set the font size of the body of the text?

    >
    > First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
    > exampel of sending an
    > email with CDOSYS:-
    >
    > Const cdoSendUsingMethod =
    > "http://schemas.microsoft.com/cdo/configuration/sendusing"
    > Const cdoSMTPServer =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    > Const cdoSMTPServerPickupDirectory =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    > Const cdoSMTPServerPort =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    >
    > Const cdoSendUsingPickup = 1
    > Const cdoSendUsingPort = 2
    >
    > Dim oMsg : Set oMsg = CreateObject("CDO.Message")
    > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    >
    > With oConfig.Fields
    > .Item(cdoSendUsingMethod) = cdoSendUsingPort
    > .Item(cdoSMTPServer) = "mysmtp.myserver.com"
    > .Item(cdoSMTPServerPort) = 25
    > .Update
    > End With
    >
    > oMsg.From = "Me <>"
    > oMsg.To = "Bloke <>"
    > oMsg.Subject = "Test"
    > oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    > World</body></html>"
    > Set oMsg.Configuration = oConfig
    >
    > oMsg.Send
    >
    >
    > Note the HTMLBody uses a style that defines the font size.
    >
    > Of course this assumes you aren't asking how to make the size of font in a
    > plain text message the bigger. The answer to that would be; you can't use a
    > HTMLBody instead.
    >
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    >
    >
    >
     
    Old Pedant, Jun 9, 2008
    #3
  4. Thanks, would I need to get my hosting service to do any configuration
    change to accept CDOSYS?
    Earl

    "Anthony Jones" <> wrote in message
    news:...
    >
    > "Earl Partridge" <> wrote in message
    > news:...
    >>If there's a newgroup for this subject, please point me to it...
    >>Is it possible to set the font size of the body of the text?

    >
    > First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
    > exampel of sending an
    > email with CDOSYS:-
    >
    > Const cdoSendUsingMethod =
    > "http://schemas.microsoft.com/cdo/configuration/sendusing"
    > Const cdoSMTPServer =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    > Const cdoSMTPServerPickupDirectory =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    > Const cdoSMTPServerPort =
    > "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    >
    > Const cdoSendUsingPickup = 1
    > Const cdoSendUsingPort = 2
    >
    > Dim oMsg : Set oMsg = CreateObject("CDO.Message")
    > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    >
    > With oConfig.Fields
    > .Item(cdoSendUsingMethod) = cdoSendUsingPort
    > .Item(cdoSMTPServer) = "mysmtp.myserver.com"
    > .Item(cdoSMTPServerPort) = 25
    > .Update
    > End With
    >
    > oMsg.From = "Me <>"
    > oMsg.To = "Bloke <>"
    > oMsg.Subject = "Test"
    > oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    > World</body></html>"
    > Set oMsg.Configuration = oConfig
    >
    > oMsg.Send
    >
    >
    > Note the HTMLBody uses a style that defines the font size.
    >
    > Of course this assumes you aren't asking how to make the size of font in a
    > plain text message the bigger. The answer to that would be; you can't use
    > a
    > HTMLBody instead.
    >
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    >
    >
     
    Earl Partridge, Jun 9, 2008
    #4
  5. If your hoster is using Win 2k or above, then no. CDO became the default
    mailing component from Win 2k. In fact, you are more likely to have
    problems getting them to set up CDONTS.

    --
    Mike Brind
    Microsoft MVP - ASP/ASP.NET


    "Earl Partridge" <> wrote in message
    news:...
    > Thanks, would I need to get my hosting service to do any configuration
    > change to accept CDOSYS?
    > Earl
    >
    > "Anthony Jones" <> wrote in message
    > news:...
    >>
    >> "Earl Partridge" <> wrote in message
    >> news:...
    >>>If there's a newgroup for this subject, please point me to it...
    >>>Is it possible to set the font size of the body of the text?

    >>
    >> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
    >> exampel of sending an
    >> email with CDOSYS:-
    >>
    >> Const cdoSendUsingMethod =
    >> "http://schemas.microsoft.com/cdo/configuration/sendusing"
    >> Const cdoSMTPServer =
    >> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    >> Const cdoSMTPServerPickupDirectory =
    >> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    >> Const cdoSMTPServerPort =
    >> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    >>
    >> Const cdoSendUsingPickup = 1
    >> Const cdoSendUsingPort = 2
    >>
    >> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
    >> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    >>
    >> With oConfig.Fields
    >> .Item(cdoSendUsingMethod) = cdoSendUsingPort
    >> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
    >> .Item(cdoSMTPServerPort) = 25
    >> .Update
    >> End With
    >>
    >> oMsg.From = "Me <>"
    >> oMsg.To = "Bloke <>"
    >> oMsg.Subject = "Test"
    >> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    >> World</body></html>"
    >> Set oMsg.Configuration = oConfig
    >>
    >> oMsg.Send
    >>
    >>
    >> Note the HTMLBody uses a style that defines the font size.
    >>
    >> Of course this assumes you aren't asking how to make the size of font in
    >> a
    >> plain text message the bigger. The answer to that would be; you can't
    >> use a
    >> HTMLBody instead.
    >>
    >>
    >> --
    >> Anthony Jones - MVP ASP/ASP.NET
    >>
    >>

    >
    >
     
    Mike Brind [MVP], Jun 9, 2008
    #5
  6. I already have CDONTS working with my host's server. I was just trying to
    figure out how change the font size in CDONTS. If I switch to CDOSYS, do I
    need to build in those 6 Const lines?
    Earl


    "Mike Brind [MVP]" <> wrote in message
    news:...
    > If your hoster is using Win 2k or above, then no. CDO became the default
    > mailing component from Win 2k. In fact, you are more likely to have
    > problems getting them to set up CDONTS.
    >
    > --
    > Mike Brind
    > Microsoft MVP - ASP/ASP.NET
    >
    >
    > "Earl Partridge" <> wrote in message
    > news:...
    >> Thanks, would I need to get my hosting service to do any configuration
    >> change to accept CDOSYS?
    >> Earl
    >>
    >> "Anthony Jones" <> wrote in message
    >> news:...
    >>>
    >>> "Earl Partridge" <> wrote in message
    >>> news:...
    >>>>If there's a newgroup for this subject, please point me to it...
    >>>>Is it possible to set the font size of the body of the text?
    >>>
    >>> First ditch CDONTS (its deprecated) and use CDOSYS instead. Here is an
    >>> exampel of sending an
    >>> email with CDOSYS:-
    >>>
    >>> Const cdoSendUsingMethod =
    >>> "http://schemas.microsoft.com/cdo/configuration/sendusing"
    >>> Const cdoSMTPServer =
    >>> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    >>> Const cdoSMTPServerPickupDirectory =
    >>> "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    >>> Const cdoSMTPServerPort =
    >>> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    >>>
    >>> Const cdoSendUsingPickup = 1
    >>> Const cdoSendUsingPort = 2
    >>>
    >>> Dim oMsg : Set oMsg = CreateObject("CDO.Message")
    >>> Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    >>>
    >>> With oConfig.Fields
    >>> .Item(cdoSendUsingMethod) = cdoSendUsingPort
    >>> .Item(cdoSMTPServer) = "mysmtp.myserver.com"
    >>> .Item(cdoSMTPServerPort) = 25
    >>> .Update
    >>> End With
    >>>
    >>> oMsg.From = "Me <>"
    >>> oMsg.To = "Bloke <>"
    >>> oMsg.Subject = "Test"
    >>> oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    >>> World</body></html>"
    >>> Set oMsg.Configuration = oConfig
    >>>
    >>> oMsg.Send
    >>>
    >>>
    >>> Note the HTMLBody uses a style that defines the font size.
    >>>
    >>> Of course this assumes you aren't asking how to make the size of font in
    >>> a
    >>> plain text message the bigger. The answer to that would be; you can't
    >>> use a
    >>> HTMLBody instead.
    >>>
    >>>
    >>> --
    >>> Anthony Jones - MVP ASP/ASP.NET
    >>>
    >>>

    >>
    >>

    >
    >
     
    Earl Partridge, Jun 9, 2008
    #6
  7. Earl Partridge

    Old Pedant Guest

    > I already have CDONTS working with my host's server. I was just trying to
    > figure out how change the font size in CDONTS.


    Oh, well, then it's easy: But you can *ONLY* specify font size *IF* you
    sent HTML Email. You can't do it if you are sending plain text email.

    So if your courrent mail body looks something like:
    mail.body = "Hello, " & name & vbNewLine _
    & "Thanks for your inquiry." & vbNewLine _
    & "We'll get back to you ASAP."

    You'll need to start using HTML line breaks, etc, in place of just the
    newlines (or CRLF or whatever you are using), and *TELL* CDONTS that you are
    using HTML, thus:

    mail.MailFormat = 0 ' specifies HTML
    mail.BodyFormat = 0 ' ditto
    mail.body = "Hello, " & name & "<p>" & vbNewLine _
    & "Thanks for your inquiry.<br/>" & vbNewLine _
    & "We'll get back to you ASAP.<p>"

    You might want to check this out:
    http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=10
     
    Old Pedant, Jun 9, 2008
    #7
  8. "Old Pedant" <> wrote in message
    news:...
    > A goof in that, Anthony:
    >
    > oMsg.HTMLBody = "<html><body style="font-size:14pt">Hello
    > World</body></html>"
    >
    > Ummm...that NEEDS to be
    >
    > oMsg.HTMLBody = "<html><body style=""font-size:14pt"">Hello
    > World</body></html>"
    >
    > Doubled quotes to embed them, of course.
    >



    Oooops. Nothing is so easy that it doesn't need testing. ;)

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 10, 2008
    #8
  9. "Neil Gould" <> wrote in message
    news:...
    > Hi Earl,
    >
    > Recently, Earl Partridge <> posted:
    >
    > > [...] If I switch to CDOSYS, do I need to build in those 6 Const lines?
    > > Earl
    > >

    > I, too, would like to know more about those const lines.
    >
    > Having just re-written our email routines, I found that including them
    > caused the mail to fail. CDOSYS works fine without them. I suspect this is
    > an ISP-specific issue, but don't know for sure.


    In what way did it fail?

    Are you using the identifiers such as cdoSendUsingMethod without defining
    them (this is possible in some circumstances)?

    OR

    Does your original code not manipulate the configuration object at all
    (again in some circumstances the ISP can ensure the configuration object is
    already set up).




    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 10, 2008
    #9
  10. Earl Partridge

    Neil Gould Guest

    Hi Earl,

    Recently, Earl Partridge <> posted:

    > [...] If I switch to CDOSYS, do I need to build in those 6 Const lines?
    > Earl
    >

    I, too, would like to know more about those const lines.

    Having just re-written our email routines, I found that including them
    caused the mail to fail. CDOSYS works fine without them. I suspect this is
    an ISP-specific issue, but don't know for sure.

    Neil
     
    Neil Gould, Jun 10, 2008
    #10
  11. Earl Partridge

    Neil Gould Guest

    Recently, Anthony Jones <> posted:

    > "Neil Gould" <> wrote in message
    > news:...
    >> Hi Earl,
    >>
    >> Recently, Earl Partridge <> posted:
    >>
    >>> [...] If I switch to CDOSYS, do I need to build in those 6 Const
    >>> lines? Earl
    >>>

    >> I, too, would like to know more about those const lines.
    >>
    >> Having just re-written our email routines, I found that including
    >> them caused the mail to fail. CDOSYS works fine without them. I
    >> suspect this is an ISP-specific issue, but don't know for sure.

    >
    > In what way did it fail?
    >

    The email didn't get sent. I consider that a failure for an email routine.
    ;-)

    Removed the lines, and all is (almost) well.

    One thing I wanted to know is why the references to a server external to
    the ISP?

    > Are you using the identifiers such as cdoSendUsingMethod without
    > defining them (this is possible in some circumstances)?
    >
    > OR
    >
    > Does your original code not manipulate the configuration object at all
    > (again in some circumstances the ISP can ensure the configuration
    > object is already set up).
    >

    I think this may be the case, and the failure could have been a conflict
    in the Method definitions, but I couldn't tell from the "outside". It's
    not the only quirk with the ISP. ;-)

    Neil
     
    Neil Gould, Jun 11, 2008
    #11
  12. "Neil Gould" <> wrote in message
    news:...
    > Recently, Anthony Jones <> posted:
    >
    > > "Neil Gould" <> wrote in message
    > > news:...
    > >> Hi Earl,
    > >>
    > >> Recently, Earl Partridge <> posted:
    > >>
    > >>> [...] If I switch to CDOSYS, do I need to build in those 6 Const
    > >>> lines? Earl
    > >>>
    > >> I, too, would like to know more about those const lines.
    > >>
    > >> Having just re-written our email routines, I found that including
    > >> them caused the mail to fail. CDOSYS works fine without them. I
    > >> suspect this is an ISP-specific issue, but don't know for sure.

    > >
    > > In what way did it fail?
    > >

    > The email didn't get sent. I consider that a failure for an email routine.
    > ;-)
    >


    I was wondering if you got some kind of error from the page doing the
    sending. If not then CDOSYS is connecting to an SMTP server and
    successfully getting the message to it. Where it goes after that who knows?

    > Removed the lines, and all is (almost) well.
    >
    > One thing I wanted to know is why the references to a server external to
    > the ISP?
    >
    > > Are you using the identifiers such as cdoSendUsingMethod without
    > > defining them (this is possible in some circumstances)?
    > >
    > > OR
    > >
    > > Does your original code not manipulate the configuration object at all
    > > (again in some circumstances the ISP can ensure the configuration
    > > object is already set up).
    > >

    > I think this may be the case, and the failure could have been a conflict
    > in the Method definitions, but I couldn't tell from the "outside". It's
    > not the only quirk with the ISP. ;-)
    >


    Try removing the code that manipulates the Configuration thereby using the
    default configuration the message object comes with.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 12, 2008
    #12
  13. Earl Partridge

    Neil Gould Guest

    Recently, Anthony Jones <> posted:

    > "Neil Gould" <> wrote in message
    > news:...
    >> Recently, Anthony Jones <> posted:
    >>
    >>> "Neil Gould" <> wrote in message
    >>> news:...
    >>>> Hi Earl,
    >>>>
    >>>> Recently, Earl Partridge <> posted:
    >>>>
    >>>>> [...] If I switch to CDOSYS, do I need to build in those 6 Const
    >>>>> lines? Earl
    >>>>>
    >>>> I, too, would like to know more about those const lines.
    >>>>
    >>>> Having just re-written our email routines, I found that including
    >>>> them caused the mail to fail. CDOSYS works fine without them. I
    >>>> suspect this is an ISP-specific issue, but don't know for sure.
    >>>
    >>> In what way did it fail?
    >>>

    >> The email didn't get sent. I consider that a failure for an email
    >> routine. ;-)
    >>

    >
    > I was wondering if you got some kind of error from the page doing the
    > sending. If not then CDOSYS is connecting to an SMTP server and
    > successfully getting the message to it. Where it goes after that who
    > knows?
    >

    No error message, no delivery.

    >> Removed the lines, and all is (almost) well.
    >>
    >> One thing I wanted to know is why the references to a server
    >> external to the ISP?
    >>
    >>> Are you using the identifiers such as cdoSendUsingMethod without
    >>> defining them (this is possible in some circumstances)?
    >>>
    >>> OR
    >>>
    >>> Does your original code not manipulate the configuration object at
    >>> all (again in some circumstances the ISP can ensure the
    >>> configuration object is already set up).
    >>>

    >> I think this may be the case, and the failure could have been a
    >> conflict in the Method definitions, but I couldn't tell from the
    >> "outside". It's not the only quirk with the ISP. ;-)
    >>

    >
    > Try removing the code that manipulates the Configuration thereby
    > using the default configuration the message object comes with.
    >

    Well, the email routine works if *all* of the cdo lines are omitted. What
    will I gain by putting them back?

    Neil
     
    Neil Gould, Jun 13, 2008
    #13
  14. "Neil Gould" <> wrote in message
    news:%...
    > Recently, Anthony Jones <> posted:
    >
    > > "Neil Gould" <> wrote in message
    > > news:...
    > >> Recently, Anthony Jones <> posted:
    > >>
    > >>> "Neil Gould" <> wrote in message
    > >>> news:...
    > >>>> Hi Earl,
    > >>>>
    > >>>> Recently, Earl Partridge <> posted:
    > >>>>
    > >>>>> [...] If I switch to CDOSYS, do I need to build in those 6 Const
    > >>>>> lines? Earl
    > >>>>>
    > >>>> I, too, would like to know more about those const lines.
    > >>>>
    > >>>> Having just re-written our email routines, I found that including
    > >>>> them caused the mail to fail. CDOSYS works fine without them. I
    > >>>> suspect this is an ISP-specific issue, but don't know for sure.
    > >>>
    > >>> In what way did it fail?
    > >>>
    > >> The email didn't get sent. I consider that a failure for an email
    > >> routine. ;-)
    > >>

    > >
    > > I was wondering if you got some kind of error from the page doing the
    > > sending. If not then CDOSYS is connecting to an SMTP server and
    > > successfully getting the message to it. Where it goes after that who
    > > knows?
    > >

    > No error message, no delivery.
    >
    > >> Removed the lines, and all is (almost) well.
    > >>
    > >> One thing I wanted to know is why the references to a server
    > >> external to the ISP?
    > >>
    > >>> Are you using the identifiers such as cdoSendUsingMethod without
    > >>> defining them (this is possible in some circumstances)?
    > >>>
    > >>> OR
    > >>>
    > >>> Does your original code not manipulate the configuration object at
    > >>> all (again in some circumstances the ISP can ensure the
    > >>> configuration object is already set up).
    > >>>
    > >> I think this may be the case, and the failure could have been a
    > >> conflict in the Method definitions, but I couldn't tell from the
    > >> "outside". It's not the only quirk with the ISP. ;-)
    > >>

    > >
    > > Try removing the code that manipulates the Configuration thereby
    > > using the default configuration the message object comes with.
    > >

    > Well, the email routine works if *all* of the cdo lines are omitted. What
    > will I gain by putting them back?
    >


    You will have to define "*all* of the cdo lines".

    If you are refering to removing some lines from the code I posted you should
    understand that all the code was CDO. Do you mean just removing the Const
    definitions, or lines affecting the configuration or something else? Can
    you post a small example of code you have now working?



    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 13, 2008
    #14
  15. Earl Partridge

    Neil Gould Guest

    (Mostly snipped for brevity)

    Recently, Anthony Jones <> posted:

    > "Neil Gould" <> wrote in message
    >>
    >>> Try removing the code that manipulates the Configuration thereby
    >>> using the default configuration the message object comes with.
    >>>


    Recently, Anthony Jones <> posted:
    >> Well, the email routine works if *all* of the cdo lines are omitted.
    >> What will I gain by putting them back?
    >>

    >
    > You will have to define "*all* of the cdo lines".
    >

    I guess I was being over-inclusive. ;-)

    > If you are refering to removing some lines from the code I posted you
    > should understand that all the code was CDO. Do you mean just
    > removing the Const definitions, or lines affecting the configuration
    > or something else? Can you post a small example of code you have now
    > working?
    >

    Sure. This is all that is needed to send mail from our particular ISP:

    Set objMail= Server.CreateObject("CDO.Message")
    With objMail
    .From = Session.Contents.Item("From")
    .To = MailData("PrimEmail")
    .Subject = Session.Contents.Item("Subj")
    .TextBody = Session.Contents.Item("Msg")
    IF Trim(Session.Contents.Item("Attach")) > "" THEN
    .AddAttachment(Session.Contents.Item("Attach"))
    END IF
    .Send
    End With
    Set objMail = Nothing

    So... my question is about the lines in your example:

    >> Const cdoSendUsingMethod =
    >> "http://schemas.microsoft.com/cdo/configuration/sendusing"
    >> Const cdoSMTPServer =
    >> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    >> Const cdoSMTPServerPickupDirectory =
    >>

    "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    >> Const cdoSMTPServerPort =
    >> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    >>
    >> Const cdoSendUsingPickup = 1
    >> Const cdoSendUsingPort = 2

    >

    What is gained by adding them, or risked by omitting them?

    Best,

    Neil
     
    Neil Gould, Jun 13, 2008
    #15
  16. "Neil Gould" <> wrote in message
    news:...
    > (Mostly snipped for brevity)
    >
    > Recently, Anthony Jones <> posted:
    >
    > > "Neil Gould" <> wrote in message
    > >>
    > >>> Try removing the code that manipulates the Configuration thereby
    > >>> using the default configuration the message object comes with.
    > >>>

    >
    > Recently, Anthony Jones <> posted:
    > >> Well, the email routine works if *all* of the cdo lines are omitted.
    > >> What will I gain by putting them back?
    > >>

    > >
    > > You will have to define "*all* of the cdo lines".
    > >

    > I guess I was being over-inclusive. ;-)
    >
    > > If you are refering to removing some lines from the code I posted you
    > > should understand that all the code was CDO. Do you mean just
    > > removing the Const definitions, or lines affecting the configuration
    > > or something else? Can you post a small example of code you have now
    > > working?
    > >

    > Sure. This is all that is needed to send mail from our particular ISP:
    >
    > Set objMail= Server.CreateObject("CDO.Message")
    > With objMail
    > .From = Session.Contents.Item("From")
    > .To = MailData("PrimEmail")
    > .Subject = Session.Contents.Item("Subj")
    > .TextBody = Session.Contents.Item("Msg")
    > IF Trim(Session.Contents.Item("Attach")) > "" THEN
    > .AddAttachment(Session.Contents.Item("Attach"))
    > END IF
    > .Send
    > End With
    > Set objMail = Nothing
    >
    > So... my question is about the lines in your example:
    >
    > >> Const cdoSendUsingMethod =
    > >> "http://schemas.microsoft.com/cdo/configuration/sendusing"
    > >> Const cdoSMTPServer =
    > >> "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    > >> Const cdoSMTPServerPickupDirectory =
    > >>

    > "http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"
    > >> Const cdoSMTPServerPort =
    > >> "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    > >>
    > >> Const cdoSendUsingPickup = 1
    > >> Const cdoSendUsingPort = 2

    > >

    > What is gained by adding them, or risked by omitting them?
    >



    Your ISP has used server extensions to specify default values for
    CDO.Configuration settings. Hence the default configuration object that the
    CDO.Message object is given on creation has the above settings already so
    your code need not worry about them.

    I included them because on a vanillia IIS server these settings are not
    defaulted.

    Gains you can achieve by using them is control of extactly how an email gets
    sent. Bear in mind that many IIS are managed by the site owners rather than
    an ISP and therefor greater control is available. I have clients who want
    to be able to dispatch emails via pickup folder. Not something you
    typically do on an ISP hosted site.

    The risks are that the ISP may not support the changes you make to the
    configuration, for example, the may insist that all SMTP traffic go out via
    their own SMTP server.

    My advice is if the ISP has configured the mail settings for the site for
    you, then use those, it keeps your code simple and is more likely to work.
    On the downside if you choose to move your code to another ISP you may find
    you need to add more code to get it work. If you use CDO from more than
    one page consider wrapping up the CDO code in class and place it in an
    include file.

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jun 14, 2008
    #16
    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. maher
    Replies:
    0
    Views:
    158
    maher
    Jul 8, 2003
  2. Steve

    CDONTS.NewMail - not working...!

    Steve, Aug 22, 2003, in forum: ASP General
    Replies:
    4
    Views:
    220
    Aaron Bertrand - MVP
    Aug 22, 2003
  3. Tom Petersen

    using a comma in the from using CDONTS.NewMail

    Tom Petersen, Sep 5, 2003, in forum: ASP General
    Replies:
    2
    Views:
    105
    Brian Staff
    Sep 7, 2003
  4. Fatcoin

    CDONTS NewMail

    Fatcoin, Sep 18, 2003, in forum: ASP General
    Replies:
    2
    Views:
    161
    Bullschmidt
    Sep 23, 2003
  5. George Viveiros

    Send Method (CDONTS NewMail Object)

    George Viveiros, Nov 17, 2003, in forum: ASP General
    Replies:
    6
    Views:
    160
    Ray at
    Nov 18, 2003
Loading...

Share This Page