Sending email with CDO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maxelcat

    Sending email with CDO

    Hi - getting very frustrated. I would really appreciate some help here!

    trying to send email via a form from my website. Have to use .asp and I have
    been round and round the houses trying to get this to work.

    On my xp pro system using IIS this works - an email appears in the folder

    When it is hosted I get this error message. I understood that I didn't need
    to set up any details about the host of the website. Lots of seaches suggest
    putting in the smtp address but I am not sure what to do. I have also seen a
    lot of talk about CDO.configurati on but again despite searching I can't find
    out what to do.

    Can somebody please help me!!!!!!!!

    Many thanks in advance

    Ed



    CDO.Message.1 error '80040220'

    The "SendUsing" configuration value is invalid.

    /version1/contact/email3.asp, line 51



    Here's a cut down version of my page

    the link is






    <%
    'here's my asp then!
    'using the post method hence the request.form methods
    if Request.Form("i sSubmitted") = "yes" then

    Dim sMsg
    'more dims....

    sTo = "edward@seldon. topdsl.co.uk"
    sFrom = "fred@wood.bear .com"
    sSubject = "The rights and wrongs of this and that"

    sParentName = Request.Form("M oniker") & " " & Request.Form("p arentname")
    sPhone = Request.Form("p hone")
    sEmail = Request.Form("e mail_address")

    'etc
    'etc - build up the content

    Dim objMail
    Set objMail = Server.CreateOb ject("CDO.Messa ge")

    objMail.From = sFrom
    objMail.To = sTo
    objMail.Subject = sSubject
    objMail.TextBod y = sTextBody

    objMail.Send

    Set objMail= Nothing

    end if

    %>


  • Egbert Nierop \(MVP for IIS\)

    #2
    Re: Sending email with CDO


    "Maxelcat" <Maxelcat@discu ssions.microsof t.com> wrote in message
    news:1789A99D-82F2-4CB2-B46C-86BA9EBC688B@mi crosoft.com...[color=blue]
    > Hi - getting very frustrated. I would really appreciate some help here!
    >
    > trying to send email via a form from my website. Have to use .asp and I
    > have
    > been round and round the houses trying to get this to work.
    >
    > On my xp pro system using IIS this works - an email appears in the folder
    >
    > When it is hosted I get this error message. I understood that I didn't
    > need[/color]

    So are you the host or somebody else? If somebody else, are you sure they
    support anonymous posting?
    [color=blue]
    > to set up any details about the host of the website. Lots of seaches
    > suggest
    > putting in the smtp address but I am not sure what to do. I have also seen
    > a
    > lot of talk about CDO.configurati on but again despite searching I can't
    > find
    > out what to do.
    >
    > Can somebody please help me!!!!!!!!
    >
    > Many thanks in advance
    >
    > Ed
    >
    >
    >
    > CDO.Message.1 error '80040220'
    >
    > The "SendUsing" configuration value is invalid.
    >
    > /version1/contact/email3.asp, line 51
    >
    >
    >
    > Here's a cut down version of my page
    >
    > the link is
    >
    > http://www.freezywater-st-georges.en...act/email3.asp
    >
    >
    >
    >
    > <%
    > 'here's my asp then!
    > 'using the post method hence the request.form methods
    > if Request.Form("i sSubmitted") = "yes" then
    >
    > Dim sMsg
    > 'more dims....
    >
    > sTo = "edward@seldon. topdsl.co.uk"
    > sFrom = "fred@wood.bear .com"
    > sSubject = "The rights and wrongs of this and that"
    >
    > sParentName = Request.Form("M oniker") & " " & Request.Form("p arentname")
    > sPhone = Request.Form("p hone")
    > sEmail = Request.Form("e mail_address")
    >
    > 'etc
    > 'etc - build up the content
    >
    > Dim objMail
    > Set objMail = Server.CreateOb ject("CDO.Messa ge")
    >
    > objMail.From = sFrom
    > objMail.To = sTo
    > objMail.Subject = sSubject
    > objMail.TextBod y = sTextBody
    >
    > objMail.Send
    >
    > Set objMail= Nothing
    >
    > end if
    >
    > %>
    >
    >[/color]

    Comment

    • Egbert Nierop \(MVP for IIS\)

      #3
      Re: Sending email with CDO


      "Maxelcat" <Maxelcat@discu ssions.microsof t.com> wrote in message
      news:1789A99D-82F2-4CB2-B46C-86BA9EBC688B@mi crosoft.com...[color=blue]
      > Hi - getting very frustrated. I would really appreciate some help here!
      >
      > trying to send email via a form from my website. Have to use .asp and I
      > have
      > been round and round the houses trying to get this to work.
      >
      > On my xp pro system using IIS this works - an email appears in the folder
      >
      > When it is hosted I get this error message. I understood that I didn't
      > need
      > to set up any details about the host of the website. Lots of seaches
      > suggest
      > putting in the smtp address but I am not sure what to do. I have also seen
      > a
      > lot of talk about CDO.configurati on but again despite searching I can't
      > find
      > out what to do.
      >
      > Can somebody please help me!!!!!!!!
      >
      > Many thanks in advance[/color]


      B.t.w. Ray Costanzo already pointed you to the solution. If you would have
      taken 1 minute, to read his links you would have seen (for instance) this...



      <!--
      METADATA
      TYPE="typelib"
      UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
      NAME="CDO for Windows 2000 Library"
      -->
      <%
      Set cdoConfig = CreateObject("C DO.Configuratio n")

      With cdoConfig.Field s
      .Item(cdoSendUs ingMethod) = cdoSendUsingPor t
      .Item(cdoSMTPSe rver) = "<enter_mail.se rver_here>"
      .Item(cdoSMTPAu thenticate) = 1
      .Item(cdoSendUs ername) = "<enter_usernam e_here>"
      .Item(cdoSendPa ssword) = "<enter_passwor d_here>"
      .Update
      End With

      Set cdoMessage = CreateObject("C DO.Message")

      With cdoMessage
      Set .Configuration = cdoConfig
      .From = "from@me.co m"
      .To = "to@me.com"
      .Subject = "Sample CDO Message"
      .TextBody = "This is a test for CDO.message"
      .Send
      End With

      Set cdoMessage = Nothing
      Set cdoConfig = Nothing
      %>

      Comment

      • Kyle Peterson

        #4
        Re: Sending email with CDO

        a form ready to go


        an article with a lot of info on cdosys




        "Maxelcat" <Maxelcat@discu ssions.microsof t.com> wrote in message
        news:1789A99D-82F2-4CB2-B46C-86BA9EBC688B@mi crosoft.com...[color=blue]
        > Hi - getting very frustrated. I would really appreciate some help here!
        >
        > trying to send email via a form from my website. Have to use .asp and I
        > have
        > been round and round the houses trying to get this to work.
        >
        > On my xp pro system using IIS this works - an email appears in the folder
        >
        > When it is hosted I get this error message. I understood that I didn't
        > need
        > to set up any details about the host of the website. Lots of seaches
        > suggest
        > putting in the smtp address but I am not sure what to do. I have also seen
        > a
        > lot of talk about CDO.configurati on but again despite searching I can't
        > find
        > out what to do.
        >
        > Can somebody please help me!!!!!!!!
        >
        > Many thanks in advance
        >
        > Ed
        >
        >
        >
        > CDO.Message.1 error '80040220'
        >
        > The "SendUsing" configuration value is invalid.
        >
        > /version1/contact/email3.asp, line 51
        >
        >
        >
        > Here's a cut down version of my page
        >
        > the link is
        >
        > http://www.freezywater-st-georges.en...act/email3.asp
        >
        >
        >
        >
        > <%
        > 'here's my asp then!
        > 'using the post method hence the request.form methods
        > if Request.Form("i sSubmitted") = "yes" then
        >
        > Dim sMsg
        > 'more dims....
        >
        > sTo = "edward@seldon. topdsl.co.uk"
        > sFrom = "fred@wood.bear .com"
        > sSubject = "The rights and wrongs of this and that"
        >
        > sParentName = Request.Form("M oniker") & " " & Request.Form("p arentname")
        > sPhone = Request.Form("p hone")
        > sEmail = Request.Form("e mail_address")
        >
        > 'etc
        > 'etc - build up the content
        >
        > Dim objMail
        > Set objMail = Server.CreateOb ject("CDO.Messa ge")
        >
        > objMail.From = sFrom
        > objMail.To = sTo
        > objMail.Subject = sSubject
        > objMail.TextBod y = sTextBody
        >
        > objMail.Send
        >
        > Set objMail= Nothing
        >
        > end if
        >
        > %>
        >
        >[/color]


        Comment

        • Maxelcat

          #5
          Re: Sending email with CDO

          [color=blue]
          >
          > So are you the host or somebody else? If somebody else, are you sure they
          > support anonymous posting?[/color]

          The website will be hosted by somebody else. I know they support .asp so I
          assumed that if I used .asp then that's all that matters. Looks like I might
          be wrong on that??????

          Comment

          • Maxelcat

            #6
            Re: Sending email with CDO

            Mnay thanks for the links.

            I looked at the first - perhpas I should be less hard on myself but I
            really want to understand what I am doing and this looses me...... u can tell
            ..... I am something of a noob to asp!!!

            The second link looks more promising though. Which method should I use? I am
            not using virtual server. What does "Using remote mail server" mean?

            Thanks in advance

            Ed


            "Kyle Peterson" wrote:
            [color=blue]
            > a form ready to go
            > http://www.powerasp.com/content/new/...ing_cdosys.asp
            >
            > an article with a lot of info on cdosys
            > http://www.powerasp.com/content/new/...ail_cdosys.asp
            >
            >
            >
            > "Maxelcat" <Maxelcat@discu ssions.microsof t.com> wrote in message
            > news:1789A99D-82F2-4CB2-B46C-86BA9EBC688B@mi crosoft.com...[color=green]
            > > Hi - getting very frustrated. I would really appreciate some help here!
            > >
            > > trying to send email via a form from my website. Have to use .asp and I
            > > have
            > > been round and round the houses trying to get this to work.
            > >
            > > On my xp pro system using IIS this works - an email appears in the folder
            > >
            > > When it is hosted I get this error message. I understood that I didn't
            > > need
            > > to set up any details about the host of the website. Lots of seaches
            > > suggest
            > > putting in the smtp address but I am not sure what to do. I have also seen
            > > a
            > > lot of talk about CDO.configurati on but again despite searching I can't
            > > find
            > > out what to do.
            > >
            > > Can somebody please help me!!!!!!!!
            > >
            > > Many thanks in advance
            > >
            > > Ed
            > >
            > >
            > >
            > > CDO.Message.1 error '80040220'
            > >
            > > The "SendUsing" configuration value is invalid.
            > >
            > > /version1/contact/email3.asp, line 51
            > >
            > >
            > >
            > > Here's a cut down version of my page
            > >
            > > the link is
            > >
            > > http://www.freezywater-st-georges.en...act/email3.asp
            > >
            > >
            > >
            > >
            > > <%
            > > 'here's my asp then!
            > > 'using the post method hence the request.form methods
            > > if Request.Form("i sSubmitted") = "yes" then
            > >
            > > Dim sMsg
            > > 'more dims....
            > >
            > > sTo = "edward@seldon. topdsl.co.uk"
            > > sFrom = "fred@wood.bear .com"
            > > sSubject = "The rights and wrongs of this and that"
            > >
            > > sParentName = Request.Form("M oniker") & " " & Request.Form("p arentname")
            > > sPhone = Request.Form("p hone")
            > > sEmail = Request.Form("e mail_address")
            > >
            > > 'etc
            > > 'etc - build up the content
            > >
            > > Dim objMail
            > > Set objMail = Server.CreateOb ject("CDO.Messa ge")
            > >
            > > objMail.From = sFrom
            > > objMail.To = sTo
            > > objMail.Subject = sSubject
            > > objMail.TextBod y = sTextBody
            > >
            > > objMail.Send
            > >
            > > Set objMail= Nothing
            > >
            > > end if
            > >
            > > %>
            > >
            > >[/color]
            >
            >
            >[/color]

            Comment

            • Egbert Nierop \(MVP for IIS\)

              #7
              Re: Sending email with CDO


              "Maxelcat" <Maxelcat@discu ssions.microsof t.com> wrote in message
              news:E6A657B6-811C-4A32-BBA7-3576D0F62209@mi crosoft.com...[color=blue]
              >[color=green]
              >>
              >> So are you the host or somebody else? If somebody else, are you sure they
              >> support anonymous posting?[/color]
              >
              > The website will be hosted by somebody else. I know they support .asp so I
              > assumed that if I used .asp then that's all that matters. Looks like I
              > might
              > be wrong on that??????[/color]

              Hi,

              You cannot assume that their config is the same as yours.
              However, I'm fully trusting that you can use CDO to sent SMTP mail. Just ask
              your ISP for the config they might require. Such as passwords or anonymous
              SMTP acceptance, and which SMTP server they use.

              Cheers,

              Comment

              Working...