Sending email with CDO

Discussion in 'ASP General' started by Maxelcat, Jun 8, 2006.

  1. Maxelcat

    Maxelcat Guest

    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.configuration 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.enfield.sch.uk/version1/contact/email3.asp




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

    Dim sMsg
    'more dims....

    sTo = ""
    sFrom = ""
    sSubject = "The rights and wrongs of this and that"

    sParentName = Request.Form("Moniker") & " " & Request.Form("parentname")
    sPhone = Request.Form("phone")
    sEmail = Request.Form("email_address")

    'etc
    'etc - build up the content

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

    objMail.From = sFrom
    objMail.To = sTo
    objMail.Subject = sSubject
    objMail.TextBody = sTextBody

    objMail.Send

    Set objMail= Nothing

    end if

    %>
     
    Maxelcat, Jun 8, 2006
    #1
    1. Advertising

  2. "Maxelcat" <> wrote in message
    news:...
    > 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


    So are you the host or somebody else? If somebody else, are you sure they
    support anonymous posting?

    > 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.configuration 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.enfield.sch.uk/version1/contact/email3.asp
    >
    >
    >
    >
    > <%
    > 'here's my asp then!
    > 'using the post method hence the request.form methods
    > if Request.Form("isSubmitted") = "yes" then
    >
    > Dim sMsg
    > 'more dims....
    >
    > sTo = ""
    > sFrom = ""
    > sSubject = "The rights and wrongs of this and that"
    >
    > sParentName = Request.Form("Moniker") & " " & Request.Form("parentname")
    > sPhone = Request.Form("phone")
    > sEmail = Request.Form("email_address")
    >
    > 'etc
    > 'etc - build up the content
    >
    > Dim objMail
    > Set objMail = Server.CreateObject("CDO.Message")
    >
    > objMail.From = sFrom
    > objMail.To = sTo
    > objMail.Subject = sSubject
    > objMail.TextBody = sTextBody
    >
    > objMail.Send
    >
    > Set objMail= Nothing
    >
    > end if
    >
    > %>
    >
    >
     
    Egbert Nierop \(MVP for IIS\), Jun 8, 2006
    #2
    1. Advertising

  3. "Maxelcat" <> wrote in message
    news:...
    > 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.configuration but again despite searching I can't
    > find
    > out what to do.
    >
    > Can somebody please help me!!!!!!!!
    >
    > Many thanks in advance



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

    http://www.aspfaq.com/show.asp?id=2026

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

    With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "<enter_mail.server_here>"
    .Item(cdoSMTPAuthenticate) = 1
    .Item(cdoSendUsername) = "<enter_username_here>"
    .Item(cdoSendPassword) = "<enter_password_here>"
    .Update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
    Set .Configuration = cdoConfig
    .From = ""
    .To = ""
    .Subject = "Sample CDO Message"
    .TextBody = "This is a test for CDO.message"
    .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    %>
     
    Egbert Nierop \(MVP for IIS\), Jun 8, 2006
    #3
  4. a form ready to go
    http://www.powerasp.com/content/new/self_submitting_contact_form_using_cdosys.asp

    an article with a lot of info on cdosys
    http://www.powerasp.com/content/new/sending_email_cdosys.asp



    "Maxelcat" <> wrote in message
    news:...
    > 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.configuration 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.enfield.sch.uk/version1/contact/email3.asp
    >
    >
    >
    >
    > <%
    > 'here's my asp then!
    > 'using the post method hence the request.form methods
    > if Request.Form("isSubmitted") = "yes" then
    >
    > Dim sMsg
    > 'more dims....
    >
    > sTo = ""
    > sFrom = ""
    > sSubject = "The rights and wrongs of this and that"
    >
    > sParentName = Request.Form("Moniker") & " " & Request.Form("parentname")
    > sPhone = Request.Form("phone")
    > sEmail = Request.Form("email_address")
    >
    > 'etc
    > 'etc - build up the content
    >
    > Dim objMail
    > Set objMail = Server.CreateObject("CDO.Message")
    >
    > objMail.From = sFrom
    > objMail.To = sTo
    > objMail.Subject = sSubject
    > objMail.TextBody = sTextBody
    >
    > objMail.Send
    >
    > Set objMail= Nothing
    >
    > end if
    >
    > %>
    >
    >
     
    Kyle Peterson, Jun 8, 2006
    #4
  5. Maxelcat

    Maxelcat Guest


    >
    > So are you the host or somebody else? If somebody else, are you sure they
    > support anonymous posting?


    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??????
     
    Maxelcat, Jun 8, 2006
    #5
  6. Maxelcat

    Maxelcat Guest

    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:

    > a form ready to go
    > http://www.powerasp.com/content/new/self_submitting_contact_form_using_cdosys.asp
    >
    > an article with a lot of info on cdosys
    > http://www.powerasp.com/content/new/sending_email_cdosys.asp
    >
    >
    >
    > "Maxelcat" <> wrote in message
    > news:...
    > > 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.configuration 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.enfield.sch.uk/version1/contact/email3.asp
    > >
    > >
    > >
    > >
    > > <%
    > > 'here's my asp then!
    > > 'using the post method hence the request.form methods
    > > if Request.Form("isSubmitted") = "yes" then
    > >
    > > Dim sMsg
    > > 'more dims....
    > >
    > > sTo = ""
    > > sFrom = ""
    > > sSubject = "The rights and wrongs of this and that"
    > >
    > > sParentName = Request.Form("Moniker") & " " & Request.Form("parentname")
    > > sPhone = Request.Form("phone")
    > > sEmail = Request.Form("email_address")
    > >
    > > 'etc
    > > 'etc - build up the content
    > >
    > > Dim objMail
    > > Set objMail = Server.CreateObject("CDO.Message")
    > >
    > > objMail.From = sFrom
    > > objMail.To = sTo
    > > objMail.Subject = sSubject
    > > objMail.TextBody = sTextBody
    > >
    > > objMail.Send
    > >
    > > Set objMail= Nothing
    > >
    > > end if
    > >
    > > %>
    > >
    > >

    >
    >
    >
     
    Maxelcat, Jun 8, 2006
    #6
  7. "Maxelcat" <> wrote in message
    news:...
    >
    >>
    >> So are you the host or somebody else? If somebody else, are you sure they
    >> support anonymous posting?

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


    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,
     
    Egbert Nierop \(MVP for IIS\), Jun 8, 2006
    #7
    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. Jay

    CDO not sending email

    Jay, Jan 15, 2004, in forum: ASP General
    Replies:
    5
    Views:
    134
  2. Irene
    Replies:
    0
    Views:
    238
    Irene
    May 1, 2004
  3. dave

    sending email using CDO Message

    dave, May 5, 2004, in forum: ASP General
    Replies:
    1
    Views:
    167
    Aaron Bertrand - MVP
    May 5, 2004
  4. dave

    sending image thru email + CDO

    dave, Jun 8, 2004, in forum: ASP General
    Replies:
    2
    Views:
    188
    Aaron [SQL Server MVP]
    Jun 8, 2004
  5. Boris

    Sending email with CDO

    Boris, Jul 7, 2004, in forum: ASP General
    Replies:
    6
    Views:
    174
Loading...

Share This Page