1
I have the following functionality in my PHP code.
// Envia o e-mail
$enviado = $mail->Send();
// Limpa os destinatários e os anexos
$mail->ClearAllRecipients();
$mail->ClearAttachments();
if( $enviado ){
return true;
} else {
return false;
}
Once the Submit on the page, fires an email using the above functionality, however if I give F5, another email is sent. I wonder if even if I updating the page (F5) I can send only one email ?
Thank you.
Take a look at Pattern PRG, it will probably help you. http://wordsideasandthings.blogspot.ca/2013/04/post-redirect-get-pattern-in-php.html
– Marcelo de Andrade
you can redirect the page in case of success and can replace that code by
return $mail->Send();
, then, outside the redirect function or not.– rray