Submit to Database AND Email

Results 1 to 4 of 4

Thread: Submit to Database AND Email

  1. #1
    baument Guest

    Default Submit to Database AND Email

    Trying to get a call to an onsubmit() function.<BR>After user hits &#039submit&#039 button, need data to be posted to access database (that&#039s how it works now) and also to make a call to a function that fires up ASPMail to send a confirmation to person.<BR>Can&#039t seem to get the onsubmit to work.<BR>Any thoughts?<BR>Thanks

  2. #2
    John Gully Guest

    Default RE: Submit to Database AND Email

    I have actually done this before, except I didn&#039t use the onsubmit(). You can submit the form to another .asp page which will process the form and run the sql needed to add the information to the access database. That same processing page can use CDONTS to email information to the user. After all the processing has completed you can redirect the user to whatever page you like and all they ever see is the form and the final page. Worked for me, but it may not be what you are looking for.<BR><BR>Hope this helps,<BR>John Gully<BR>

  3. #3
    Steven Woolston Guest

    Default RE: Submit to Database AND Email

    I have tried to use this method, but came across some difficulties. The CDONTS dll must use a mailbox that exists on your current web server, therefore, there is no way to derive the email address from the user. I tried to do this from a form, but the user could easily enter a phoney email address, because the email is sent from your OWN web server, not the user&#039s email box.<BR><BR>Is this correct, and is there any way to get around this problem ?<BR><BR>Steven

  4. #4
    John Gully Guest

    Default RE: Submit to Database AND Email

    You are correct the CDONTS only uses the SMTP server and anything can be used for the e-mail address of the sender. The quickest way to ensure a valid e-mail address is being used it not to allow the user to input the address.<BR><BR>1. have the user sign up for an "account." In other words ask them to select a username and input an e-mail address. Then e-mail them a random password.<BR><BR>2. The user then logs in with the password you generated. You pull their e-mail address from your database and use that when they send mail.<BR><BR>I know this is a bit more coding than you had originally planned for but it will work!

Posting Permissions

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