I have a form which sends email and then needs to redirect to another page. I used the following form tag:
<form name="sendmail" method="post" onSubmit="return send_mail()" action="www.example.com" target="_parent">

The send_mail() function validates the form fields and then sends the form if all fields are validated, prompting the user with a javascript alert message saying that the email is sent.
The send_mail() function is a php function and the form uses HTML and javascript.

Problem:
After the user submits the form, the send_mail() function does get called, since it displays the alert message, but no email actually gets sent. However, if I remove the action and target attributes from the form tag, the email does get sent. Any idea what could be wrong?