form to mail newbie

Discussion in 'ASP General' started by Auddog, Feb 1, 2005.

  1. Auddog

    Auddog Guest

    First thanks for any help that you might be able to provide.

    I've written a very small web form that I want to have emailed to me when a
    user clicks submit. I have researched on the interent, but I'm not sure now
    that it as easy as I first thought as most talk about remote servers. I
    have a windows 2000 server sp4 running exchange 2000 that also is my
    webserver IIS 5.

    I know this is simply enough, I'm just need some direction to get started.

    Thanks

    A
    Auddog, Feb 1, 2005
    #1
    1. Advertising

  2. You should be able to do/start with something as simple as this:

    <%
    Dim oCDO
    Set oCDO = CreateObject("CDO.Message")
    oCDO.From = "your@yourdomain"
    oCDO.To = "you@yourdomain"
    oCDO.Subject = "Form results test"
    oCDO.TextBody = "Value of form field is " & Request.Form("nameOfFormField")
    oCDO.Send
    Set oCDO = Nothing
    %>

    See here for more details:
    http://www.aspfaq.com/show.asp?id=2026

    Ray at work

    "Auddog" <> wrote in message
    news:...
    > First thanks for any help that you might be able to provide.
    >
    > I've written a very small web form that I want to have emailed to me when

    a
    > user clicks submit. I have researched on the interent, but I'm not sure

    now
    > that it as easy as I first thought as most talk about remote servers. I
    > have a windows 2000 server sp4 running exchange 2000 that also is my
    > webserver IIS 5.
    >
    > I know this is simply enough, I'm just need some direction to get started.
    >
    > Thanks
    >
    > A
    >
    >
    Ray Costanzo [MVP], Feb 1, 2005
    #2
    1. Advertising

  3. Auddog

    Auddog Guest

    Ray,

    Thanks for the quick reply. Greatly appreciated.

    I do have one question. I'm testing this on my desktop running windows xp
    with sp2, if I remember right that is also IIS 5.1 and I do have the smtp
    service running. When I run the web form here is the error that I get:

    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'From'
    /company/report_problem.asp, line 9


    Here is my code:

    <%
    DIM strFirstName, strLastName, strComments
    strFirstName = request.form("fname")
    strLastName = request.form("lname")
    strComments = request.form("description")

    DIM oCDO, strMsgHeader
    Set oCDO = CreateObject("CDO.Message")
    oCDO.From ""
    oCDO.To
    oCDO.Subject = "Problems"
    strMsgHeader = "This email was delivered from the intranet website." &
    vbCrLf & vbCrLf
    oCDO.Body = strMsgHeader & "First Name: " & strFirstName & vbCrLf & _
    "Last Name: " & strLastName & vbCrLf & _
    "Description: " & vbCrLf & strComments
    oCDO.Send
    Set oCDO = Nothing
    %>

    <P>
    <%
    Response.Write strFirstName & ",<br>"
    Response.Write "Your message has been successfully sent."
    %>,</P>

    Thanks again Ray


    A


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > You should be able to do/start with something as simple as this:
    >
    > <%
    > Dim oCDO
    > Set oCDO = CreateObject("CDO.Message")
    > oCDO.From = "your@yourdomain"
    > oCDO.To = "you@yourdomain"
    > oCDO.Subject = "Form results test"
    > oCDO.TextBody = "Value of form field is " &
    > Request.Form("nameOfFormField")
    > oCDO.Send
    > Set oCDO = Nothing
    > %>
    >
    > See here for more details:
    > http://www.aspfaq.com/show.asp?id=2026
    >
    > Ray at work
    >
    > "Auddog" <> wrote in message
    > news:...
    >> First thanks for any help that you might be able to provide.
    >>
    >> I've written a very small web form that I want to have emailed to me when

    > a
    >> user clicks submit. I have researched on the interent, but I'm not sure

    > now
    >> that it as easy as I first thought as most talk about remote servers. I
    >> have a windows 2000 server sp4 running exchange 2000 that also is my
    >> webserver IIS 5.
    >>
    >> I know this is simply enough, I'm just need some direction to get
    >> started.
    >>
    >> Thanks
    >>
    >> A
    >>
    >>

    >
    >
    Auddog, Feb 1, 2005
    #3
  4. Can you post lines 1-10 of your page?

    Ray at work


    "Auddog" <> wrote in message
    news:...
    > Ray,
    >
    > Thanks for the quick reply. Greatly appreciated.
    >
    > I do have one question. I'm testing this on my desktop running windows xp
    > with sp2, if I remember right that is also IIS 5.1 and I do have the smtp
    > service running. When I run the web form here is the error that I get:
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A01B6)
    > Object doesn't support this property or method: 'From'
    > /company/report_problem.asp, line 9
    Ray Costanzo [MVP], Feb 1, 2005
    #4
  5. Auddog

    Auddog Guest

    Okay Ray, I found that error and here is my code for this page. But now I
    get a different error which I have pasted below my page code. Thanks again
    for looking over this code.

    <%
    DIM strFirstName, strLastName, strComments
    strFirstName = request.form("fname")
    strLastName = request.form("lname")
    strComments = request.form("description")

    DIM oCDO, strMsgHeader
    Set oCDO = CreateObject("CDO.Message")
    oCDO.From =""
    oCDO.To = ""
    oCDO.Subject = "Problems"
    strMsgHeader = "This email was delivered from the intranet website." &
    vbCrLf & vbCrLf
    oCDO.TextBody = strMsgHeader & "First Name: " & strFirstName & vbCrLf & _
    "Last Name: " & strLastName & vbCrLf & _
    "Description: " & vbCrLf & strComments
    oCDO.Send
    Set oCDO = Nothing
    %>

    <P>
    <%
    Response.Write strFirstName & ",<br>"
    Response.Write "Your message has been successfully sent."
    %>,</P>



    Error Type:
    CDO.Message.1 (0x80040220)
    The "SendUsing" configuration value is invalid.
    /company/report_problem.asp, line 17

    Let me know if you need anything else.

    A


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Can you post lines 1-10 of your page?
    >
    > Ray at work
    >
    >
    > "Auddog" <> wrote in message
    > news:...
    >> Ray,
    >>
    >> Thanks for the quick reply. Greatly appreciated.
    >>
    >> I do have one question. I'm testing this on my desktop running windows
    >> xp
    >> with sp2, if I remember right that is also IIS 5.1 and I do have the smtp
    >> service running. When I run the web form here is the error that I get:
    >>
    >> Error Type:
    >> Microsoft VBScript runtime (0x800A01B6)
    >> Object doesn't support this property or method: 'From'
    >> /company/report_problem.asp, line 9

    >
    >
    Auddog, Feb 1, 2005
    #5
    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. Jo
    Replies:
    3
    Views:
    1,216
  2. thereaper

    Newbie - Form to mail help

    thereaper, Nov 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    288
    thereaper
    Nov 26, 2003
  3. Tim
    Replies:
    12
    Views:
    1,265
    kchayka
    Jul 15, 2005
  4. nauticalmac

    Mail insertion hack on Send Mail form

    nauticalmac, Dec 23, 2005, in forum: ASP General
    Replies:
    0
    Views:
    266
    nauticalmac
    Dec 23, 2005
  5. Ferrous Cranus
    Replies:
    42
    Views:
    365
    Ferrous Cranus
    Sep 6, 2013
Loading...

Share This Page