• Answers
  • Web

Examples of ASP form which send both email and insert row to a table

Where can I find examples of ASP form which send both email (via server not the user email client) and insert row to table when pressing a button.


Share Send to a friend Watch Report
 
 

Posted Answers

 
18 helpful answers

Born. Having the time of my life. Will die.

Hi This is your form (I kept it as simple as possible)



<html>
    <head>
        <title>Form</title>
    </head>
    <body>
        <form action="form.asp" method="post">
            Your name: <input type="text" name="fname" size="20" />
            <input type="submit" value="Submit" />
        </form>
    </body>
</html>


This is your form.asp (the action target of the form above).

<%
' Get the value of the field fname in the form above into a variable we declare
dim fname
fname = Request.Form("fname")

Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Your first name"
myMail.From = "mymail@mydomain.com"
myMail.To = "someone@somedomain.com"
myMail.TextBody = "Your first name is: " & fname
myMail.Send
set myMail = nothing

' this is a connection to an Access database
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "X:/somewhere/yourdatabase.mdb"

' This is the SQL
sql="INSERT INTO tablename (firstName)"
sql=sql & " VALUES "
sql=sql & "('" & fname  & "')"

' This execute the sql anc close the connection
on error resume next
conn.Execute sql,recaffected
conn.close
%>
Posted 2007-04-28T08:10:51Z
ravidor was invited by Yedda to answer this question.

Sign in to participate

Got an answer for talr? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

Can you recommend a reliable Email Server Host?

Does anyone have a recommendation for reliable, professional email hosting? I want to be able to administer an an arbitrary number ...
Submitted by Premasagar   2 years ago.
  • viewed 907 times
Last answer posted 2 years ago by dassinger


Q:

Free web servers to use existing domain, web designing tips, how to create a web page without others assistence?

where can I get free trust worthy web designing hosting site servers (without adds or banners)for my existing domain . And methods ...
Submitted by Raj kumar   1 year ago.
  • viewed 152 times
Last answer posted 2 months ago by Mark K.


Q:

I'm looking for a FREE web server which I can send ...

I'm looking for a FREE web server which I can send emails through. Thanks!!!
Submitted by amitre   2 years ago.
  • viewed 582 times
Last answer posted 2 months ago by Mark K.



» More...

Explore Related Posts in Forums

Need shared hosting ASAP (web-based email)

I am desperately looking for shared web hosting account which includes at least 25 POP3 E-mails nice shared hosting plans at affordable price. Can I rely on this company? an unlimited amount of email accounts and forwarders...Not any on the simplest web hosting accounts...

need help creating an email/ web mail server

How ever I need now to create the mail server that would allow people to log on and check their mail it! I also had issues with the forum so I used a another host for it, and until i figure it out that comes standard with your hosting account? It's already setup along with Horde and NeoMail and can send

web hosting\email question.

Posted 02 August 2008 - 03:16 AM Does anyone know a web hosting where customers can access email anyone know a web hosting where customers can access email via http , not smtp or pop3? HTTP but you... August 2008 - 07:01 AM Quote: Quote: Does anyone know a web hosting where customers can access email...
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License