Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Form Question

  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    Georgia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Form Question

    This might be very basic but i do not know the answer:

    Do you know how?
    If a User fills out a form (like a feedback form for example), have that form go to a database, get stored, and have the admin of that database receive an e-mail saying the database has been updated.

    Here's the situation. I work for a school system that basically wants on online application. I can create the database with the required fields and point them in the fields and even write to database, that's the easy part (I can handle this). What I need is some code that once the data is wrote to the database, it e-mails the recipient that a new application has been submitted. If you could get me started, I could finish it out.

    My part:
    <FORM NAME="frmUser" ACTION="addnewapp.asp" METHOD="POST">

    and have addnewapp.asp open the database and write to required fields.

    Your part:
    What next? I cannot use CGI or DLL's to help me do this. So Matt's formmail.pl is out of the question.

    Thank you in advance, Phillip Ewing
    Last edited by phillip_ewing; 02-10-2003 at 05:10 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    You can use the built in SMTP service (CDONTS) to format and send emails. It may or may not be enabled by default.

    http://www.aspfaqs.com/ASPScripts/PrintFAQ.asp?FAQID=25

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    Georgia
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CDONTS

    I was asked to elaborate on my techniques:

    I am planning on using ASP and CDONTS.

    My idea:
    After you successfully insert the data, call a sub
    procedure that sends an email confirmation using
    CDONTS.

    But if my website is being hosted by just a regular asp host. How do you get that dll to work? How do you register a dll if you do not accessibility to regedit?

    I do not know that much about CDONTS and how they work. I am not opposed to that method but where do I begin. CDONTS registration is done by the hosting provider?? Do they do that kind of stuff?

    Thank you in advance, Phillip

  • #4
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You don't need to register anything. CDONTS is a built in part of ASP.

  • #5
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Most webhost providers have CDONTS running by default since sending emails is so common. I would at least try sending an email to test out this assumption before you get too involved in the specifics.

    If it doesn't work, they are probably aware of this and specifically have it turned off since it is just another possibly security problem. Most companies do have it turned on though.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What they said... here's a basic CDONTS email:
    Code:
    Dim objMail, MessageBody
    
    Set objMail = Server.CreateObject("CDONTS.NewMail")
    objMail.To = ""
    objMail.From = ""
    objMail.cc = ""
    objMail.bcc = ""
    'objMail.mailFormat = 0 'This is for HTML
    'objMail.bodyFormat = 0 'This is for HTML
    
    MessageBody = "" & vbCrLf 'This is the body of the message, duh!
    MessageBody = MessageBody & "" & vbCrLf
    
    objMail.Subject = ""
    objMail.Body = MessageBody
    objMail.Send
    Set objMail = Nothing
    To include variables (such as those requested from a form), simply include them in the MessageBody, Subject, or whatever like:

    MessageBody = MessageBody & "Subject: " & Request.Form("Subject") & vbCrLf & vbCrLf

    vbCrLf is a "Carriage Return/Line Feed".

    Much more information is available at:

    http://www.aspfaqs.com/aspfaqs/ShowC...y.asp?CatID=10

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •