...

View Full Version : mailto function not working with submit button



Cheryl399
05-11-2010, 01:11 PM
Hello,

I have a form that when it is filled out by a user it is then updated in a database, what i would like is for that information to be sent via email at the same time. Ive tried the mailto function but doesnt seem to work

my code is:

<input type="Submit" name="SubmitButton" id="SubmitButton" value="Submit" onclick="mailto:xxxxx@xx.com"/>


any help would be appreciated

thanks :)

mbaker
05-12-2010, 09:53 AM
I have a form that when it is filled out by a user it is then updated in a database, what i would like is for that information to be sent via email at the same time. Ive tried the mailto function but doesnt seem to work

my code is:

<input type="Submit" name="SubmitButton" id="SubmitButton" value="Submit" onclick="mailto:xxxxx@xx.com"/>

Even if the mailto on your submit button does work, it won't take the values from your form. To do that it would need to be given as the action for the form. However as you already must have an action for your form to send the data to your database it is not going to be possible to have the form also send the data by email.

In any event, given the patchy response you will get when using mailto it is probably advisable to avoid using it. [mailto depends upon at least both the browser being set up to respond to mailto and the user clicking on send when their email client pops up with a mail message]

If you want the information to be also emailed to you, it would be better to modify the server side script that places the information into the database.

If you don't have access to that script, it might be possible to set up an intermediate script that sends the email and sends the data to the original script. However I've never done that, and don't know if it could be implemented in practice.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum