CDOSYS - Newbie

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

  1. monki

    monki Guest

    I am having a problem getting a CDOSYS mail form working. the form processes
    ok on the server however the email is never received.

    The page was running fine with CDONTS until the server was upgraded,
    unfortunately the hosting company didn't bother to inform me so I have
    several mail forms that no longer work.

    I have used the code provided by my hosting company. (creating the object &
    setting the fields), but I cant get the form to send a mail.

    Is this an error in my code, their code or a problem with the server.

    Any help would be greatly appreciated.

    Thanks in advance.

    J.

    <%
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")

    Set Flds = iConf.Fields
    Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    ry") = "c:\inetpub\mailroot\pickup"
    Flds.Update


    strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
    strBody = strBody & "<html><head><title>Quote</title></head><body
    bgcolor=silver><font face=arial size=3><p>Email from Fully Present Web
    site</p> <p><b>Name:</b>&nbsp;"
    strBody = strBody & strFromName
    strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    strBody = strBody & strFromEmail
    strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    strBody = strBody & strSubject
    strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    strBody = strBody & strContent
    strBody = strBody & "</p><p><b>"
    'strBody = strBody & strAdd
    strBody = strBody & "to Mail List</b>&nbsp;</p></font></body></html>"



    Set iMsg.Configuration = iConf
    iMsg.To = ""
    iMsg.From = Trim(Request.Form("Email"))
    iMsg.Subject = Trim(Request.Form("Subject"))
    iMsg.TextBody = Trim(Request.Form("Content"))
    iMsg.Send

    Response.Redirect "thanks.asp"
    Response.End

    %>
    monki, Jan 8, 2004
    #1
    1. Advertising

  2. monki

    Ray at Guest

    Do you get an error when you load this page?

    Ray at work

    "monki" <> wrote in message
    news:zPhLb.11208$...
    > I am having a problem getting a CDOSYS mail form working. the form

    processes
    > ok on the server however the email is never received.
    >
    > The page was running fine with CDONTS until the server was upgraded,
    > unfortunately the hosting company didn't bother to inform me so I have
    > several mail forms that no longer work.
    >
    > I have used the code provided by my hosting company. (creating the object

    &
    > setting the fields), but I cant get the form to send a mail.
    >
    > Is this an error in my code, their code or a problem with the server.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks in advance.
    >
    > J.
    >
    > <%
    > Set iMsg = CreateObject("CDO.Message")
    > Set iConf = CreateObject("CDO.Configuration")
    >
    > Set Flds = iConf.Fields
    > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    > ry") = "c:\inetpub\mailroot\pickup"
    > Flds.Update
    >
    >
    > strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
    > strBody = strBody & "<html><head><title>Quote</title></head><body
    > bgcolor=silver><font face=arial size=3><p>Email from Fully Present Web
    > site</p> <p><b>Name:</b>&nbsp;"
    > strBody = strBody & strFromName
    > strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    > strBody = strBody & strFromEmail
    > strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    > strBody = strBody & strSubject
    > strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    > strBody = strBody & strContent
    > strBody = strBody & "</p><p><b>"
    > 'strBody = strBody & strAdd
    > strBody = strBody & "to Mail List</b>&nbsp;</p></font></body></html>"
    >
    >
    >
    > Set iMsg.Configuration = iConf
    > iMsg.To = ""
    > iMsg.From = Trim(Request.Form("Email"))
    > iMsg.Subject = Trim(Request.Form("Subject"))
    > iMsg.TextBody = Trim(Request.Form("Content"))
    > iMsg.Send
    >
    > Response.Redirect "thanks.asp"
    > Response.End
    >
    > %>
    >
    >
    Ray at, Jan 8, 2004
    #2
    1. Advertising

  3. monki

    monki Guest

    Ray

    I do not receive any errors from the page, it runs through the code and then
    redirects to the thanks.asp page.

    I have tried changing the configuration fields but that allways gives a 500
    error

    J

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:#KR#...
    > Do you get an error when you load this page?
    >
    > Ray at work
    >
    > "monki" <> wrote in message
    > news:zPhLb.11208$...
    > > I am having a problem getting a CDOSYS mail form working. the form

    > processes
    > > ok on the server however the email is never received.
    > >
    > > The page was running fine with CDONTS until the server was upgraded,
    > > unfortunately the hosting company didn't bother to inform me so I have
    > > several mail forms that no longer work.
    > >
    > > I have used the code provided by my hosting company. (creating the

    object
    > &
    > > setting the fields), but I cant get the form to send a mail.
    > >
    > > Is this an error in my code, their code or a problem with the server.
    > >
    > > Any help would be greatly appreciated.
    > >
    > > Thanks in advance.
    > >
    > > J.
    > >
    > > <%
    > > Set iMsg = CreateObject("CDO.Message")
    > > Set iConf = CreateObject("CDO.Configuration")
    > >
    > > Set Flds = iConf.Fields
    > > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    > >

    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    > > ry") = "c:\inetpub\mailroot\pickup"
    > > Flds.Update
    > >
    > >
    > > strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
    > > strBody = strBody & "<html><head><title>Quote</title></head><body
    > > bgcolor=silver><font face=arial size=3><p>Email from Fully Present Web
    > > site</p> <p><b>Name:</b>&nbsp;"
    > > strBody = strBody & strFromName
    > > strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    > > strBody = strBody & strFromEmail
    > > strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    > > strBody = strBody & strSubject
    > > strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    > > strBody = strBody & strContent
    > > strBody = strBody & "</p><p><b>"
    > > 'strBody = strBody & strAdd
    > > strBody = strBody & "to Mail List</b>&nbsp;</p></font></body></html>"
    > >
    > >
    > >
    > > Set iMsg.Configuration = iConf
    > > iMsg.To = ""
    > > iMsg.From = Trim(Request.Form("Email"))
    > > iMsg.Subject = Trim(Request.Form("Subject"))
    > > iMsg.TextBody = Trim(Request.Form("Content"))
    > > iMsg.Send
    > >
    > > Response.Redirect "thanks.asp"
    > > Response.End
    > >
    > > %>
    > >
    > >

    >
    >
    monki, Jan 8, 2004
    #3
  4. monki

    Ray at Guest

    Try response.writing all your values to the page instead of trying to send
    an e-mail so you can get an idea of what your CDO object is trying to work
    with. And for the 500 errors, see this.
    http://www.aspfaq.com/show.asp?id=2109

    Ray at work

    "monki" <> wrote in message
    news:bKiLb.29$...
    > Ray
    >
    > I do not receive any errors from the page, it runs through the code and

    then
    > redirects to the thanks.asp page.
    >
    > I have tried changing the configuration fields but that allways gives a

    500
    > error
    >
    > J
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:#KR#...
    > > Do you get an error when you load this page?
    > >
    > > Ray at work
    > >
    > > "monki" <> wrote in message
    > > news:zPhLb.11208$...
    > > > I am having a problem getting a CDOSYS mail form working. the form

    > > processes
    > > > ok on the server however the email is never received.
    > > >
    > > > The page was running fine with CDONTS until the server was upgraded,
    > > > unfortunately the hosting company didn't bother to inform me so I have
    > > > several mail forms that no longer work.
    > > >
    > > > I have used the code provided by my hosting company. (creating the

    > object
    > > &
    > > > setting the fields), but I cant get the form to send a mail.
    > > >
    > > > Is this an error in my code, their code or a problem with the server.
    > > >
    > > > Any help would be greatly appreciated.
    > > >
    > > > Thanks in advance.
    > > >
    > > > J.
    > > >
    > > > <%
    > > > Set iMsg = CreateObject("CDO.Message")
    > > > Set iConf = CreateObject("CDO.Configuration")
    > > >
    > > > Set Flds = iConf.Fields
    > > > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    > > >

    > >

    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    > > > ry") = "c:\inetpub\mailroot\pickup"
    > > > Flds.Update
    > > >
    > > >
    > > > strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
    > > > strBody = strBody & "<html><head><title>Quote</title></head><body
    > > > bgcolor=silver><font face=arial size=3><p>Email from Fully Present Web
    > > > site</p> <p><b>Name:</b>&nbsp;"
    > > > strBody = strBody & strFromName
    > > > strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    > > > strBody = strBody & strFromEmail
    > > > strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    > > > strBody = strBody & strSubject
    > > > strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    > > > strBody = strBody & strContent
    > > > strBody = strBody & "</p><p><b>"
    > > > 'strBody = strBody & strAdd
    > > > strBody = strBody & "to Mail List</b>&nbsp;</p></font></body></html>"
    > > >
    > > >
    > > >
    > > > Set iMsg.Configuration = iConf
    > > > iMsg.To = ""
    > > > iMsg.From = Trim(Request.Form("Email"))
    > > > iMsg.Subject = Trim(Request.Form("Subject"))
    > > > iMsg.TextBody = Trim(Request.Form("Content"))
    > > > iMsg.Send
    > > >
    > > > Response.Redirect "thanks.asp"
    > > > Response.End
    > > >
    > > > %>
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Jan 8, 2004
    #4
  5. monki

    monki Guest

    Ray

    i think its a server problem, i have tried passing the strings into a
    seperate page and they are ok, ive just set up iis on my pc and the page
    runs fine and puts the message into the mail root\pickup folder

    thanks for your suggestions

    j



    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > Try response.writing all your values to the page instead of trying to send
    > an e-mail so you can get an idea of what your CDO object is trying to work
    > with. And for the 500 errors, see this.
    > http://www.aspfaq.com/show.asp?id=2109
    >
    > Ray at work
    >
    > "monki" <> wrote in message
    > news:bKiLb.29$...
    > > Ray
    > >
    > > I do not receive any errors from the page, it runs through the code and

    > then
    > > redirects to the thanks.asp page.
    > >
    > > I have tried changing the configuration fields but that allways gives a

    > 500
    > > error
    > >
    > > J
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > > news:#KR#...
    > > > Do you get an error when you load this page?
    > > >
    > > > Ray at work
    > > >
    > > > "monki" <> wrote in message
    > > > news:zPhLb.11208$...
    > > > > I am having a problem getting a CDOSYS mail form working. the form
    > > > processes
    > > > > ok on the server however the email is never received.
    > > > >
    > > > > The page was running fine with CDONTS until the server was upgraded,
    > > > > unfortunately the hosting company didn't bother to inform me so I

    have
    > > > > several mail forms that no longer work.
    > > > >
    > > > > I have used the code provided by my hosting company. (creating the

    > > object
    > > > &
    > > > > setting the fields), but I cant get the form to send a mail.
    > > > >
    > > > > Is this an error in my code, their code or a problem with the

    server.
    > > > >
    > > > > Any help would be greatly appreciated.
    > > > >
    > > > > Thanks in advance.
    > > > >
    > > > > J.
    > > > >
    > > > > <%
    > > > > Set iMsg = CreateObject("CDO.Message")
    > > > > Set iConf = CreateObject("CDO.Configuration")
    > > > >
    > > > > Set Flds = iConf.Fields
    > > > > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    > > > >
    > > >

    > >

    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    > > > > ry") = "c:\inetpub\mailroot\pickup"
    > > > > Flds.Update
    > > > >
    > > > >
    > > > > strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" &

    vbCrLf
    > > > > strBody = strBody & "<html><head><title>Quote</title></head><body
    > > > > bgcolor=silver><font face=arial size=3><p>Email from Fully Present

    Web
    > > > > site</p> <p><b>Name:</b>&nbsp;"
    > > > > strBody = strBody & strFromName
    > > > > strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    > > > > strBody = strBody & strFromEmail
    > > > > strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    > > > > strBody = strBody & strSubject
    > > > > strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    > > > > strBody = strBody & strContent
    > > > > strBody = strBody & "</p><p><b>"
    > > > > 'strBody = strBody & strAdd
    > > > > strBody = strBody & "to Mail

    List</b>&nbsp;</p></font></body></html>"
    > > > >
    > > > >
    > > > >
    > > > > Set iMsg.Configuration = iConf
    > > > > iMsg.To = ""
    > > > > iMsg.From = Trim(Request.Form("Email"))
    > > > > iMsg.Subject = Trim(Request.Form("Subject"))
    > > > > iMsg.TextBody = Trim(Request.Form("Content"))
    > > > > iMsg.Send
    > > > >
    > > > > Response.Redirect "thanks.asp"
    > > > > Response.End
    > > > >
    > > > > %>
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    monki, Jan 8, 2004
    #5
  6. monki

    Ray at Guest

    If your messages are sitting in pickup, the SMTP service is not running, so
    it sounds.

    net start smtpsvc

    Ray at work

    "monki" <> wrote in message
    news:e4kLb.1234$...
    > Ray
    >
    > i think its a server problem, i have tried passing the strings into a
    > seperate page and they are ok, ive just set up iis on my pc and the page
    > runs fine and puts the message into the mail root\pickup folder
    >
    > thanks for your suggestions
    >
    > j
    >
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:...
    > > Try response.writing all your values to the page instead of trying to

    send
    > > an e-mail so you can get an idea of what your CDO object is trying to

    work
    > > with. And for the 500 errors, see this.
    > > http://www.aspfaq.com/show.asp?id=2109
    > >
    > > Ray at work
    > >
    > > "monki" <> wrote in message
    > > news:bKiLb.29$...
    > > > Ray
    > > >
    > > > I do not receive any errors from the page, it runs through the code

    and
    > > then
    > > > redirects to the thanks.asp page.
    > > >
    > > > I have tried changing the configuration fields but that allways gives

    a
    > > 500
    > > > error
    > > >
    > > > J
    > > >
    > > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in

    message
    > > > news:#KR#...
    > > > > Do you get an error when you load this page?
    > > > >
    > > > > Ray at work
    > > > >
    > > > > "monki" <> wrote in message
    > > > > news:zPhLb.11208$...
    > > > > > I am having a problem getting a CDOSYS mail form working. the form
    > > > > processes
    > > > > > ok on the server however the email is never received.
    > > > > >
    > > > > > The page was running fine with CDONTS until the server was

    upgraded,
    > > > > > unfortunately the hosting company didn't bother to inform me so I

    > have
    > > > > > several mail forms that no longer work.
    > > > > >
    > > > > > I have used the code provided by my hosting company. (creating the
    > > > object
    > > > > &
    > > > > > setting the fields), but I cant get the form to send a mail.
    > > > > >
    > > > > > Is this an error in my code, their code or a problem with the

    > server.
    > > > > >
    > > > > > Any help would be greatly appreciated.
    > > > > >
    > > > > > Thanks in advance.
    > > > > >
    > > > > > J.
    > > > > >
    > > > > > <%
    > > > > > Set iMsg = CreateObject("CDO.Message")
    > > > > > Set iConf = CreateObject("CDO.Configuration")
    > > > > >
    > > > > > Set Flds = iConf.Fields
    > > > > > Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") =

    1
    > > > > >
    > > > >
    > > >

    > >

    >

    Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirecto
    > > > > > ry") = "c:\inetpub\mailroot\pickup"
    > > > > > Flds.Update
    > > > > >
    > > > > >
    > > > > > strBody = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" &

    > vbCrLf
    > > > > > strBody = strBody & "<html><head><title>Quote</title></head><body
    > > > > > bgcolor=silver><font face=arial size=3><p>Email from Fully Present

    > Web
    > > > > > site</p> <p><b>Name:</b>&nbsp;"
    > > > > > strBody = strBody & strFromName
    > > > > > strBody = strBody & "</p><p><b>Email:</b>&nbsp;"
    > > > > > strBody = strBody & strFromEmail
    > > > > > strBody = strBody & "</p><p><b>Subject:</b>&nbsp;"
    > > > > > strBody = strBody & strSubject
    > > > > > strBody = strBody & "</p><p><b>Content:</b>&nbsp;<br>"
    > > > > > strBody = strBody & strContent
    > > > > > strBody = strBody & "</p><p><b>"
    > > > > > 'strBody = strBody & strAdd
    > > > > > strBody = strBody & "to Mail

    > List</b>&nbsp;</p></font></body></html>"
    > > > > >
    > > > > >
    > > > > >
    > > > > > Set iMsg.Configuration = iConf
    > > > > > iMsg.To = ""
    > > > > > iMsg.From = Trim(Request.Form("Email"))
    > > > > > iMsg.Subject = Trim(Request.Form("Subject"))
    > > > > > iMsg.TextBody = Trim(Request.Form("Content"))
    > > > > > iMsg.Send
    > > > > >
    > > > > > Response.Redirect "thanks.asp"
    > > > > > Response.End
    > > > > >
    > > > > > %>
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Jan 8, 2004
    #6
    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. René de Leeuw

    embed pictures in a cdosys sent message

    René de Leeuw, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    405
    René de Leeuw
    Jul 22, 2003
  2. martin

    cdosys.dll and sending mail

    martin, Jul 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,084
    wolfgangiron
    Jan 4, 2012
  3. Luqman
    Replies:
    0
    Views:
    384
    Luqman
    Nov 29, 2004
  4. Nitin

    cdosys

    Nitin, Apr 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    584
    =?Utf-8?B?RGF2ZSBCcml0dG9u?=
    Apr 15, 2005
  5. tshad

    CDOSYS problems

    tshad, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    394
    tshad
    Jun 23, 2005
Loading...

Share This Page