NaGGi Posted August 19, 2009 Share Posted August 19, 2009 Hi, I'm pretty new with PHP coding and tried to sent an email with mail function. I got the email but it always sends the same email 3 times and I don't have a clue why Any ideas why this is happening? Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/ Share on other sites More sharing options...
deansatch Posted August 19, 2009 Share Posted August 19, 2009 not without seeing the code first Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901716 Share on other sites More sharing options...
ignace Posted August 19, 2009 Share Posted August 19, 2009 Any ideas why this is happening? Because you did something wrong. Question solved, mark this topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901729 Share on other sites More sharing options...
NaGGi Posted August 19, 2009 Author Share Posted August 19, 2009 Sorry for leaving the code out. This is pretty much all the code there is except some HTML. <?php $to = "myemail@gmail.com"; $subject = "Postin aihe"; $message = "sähköpostin viesti mutta miks tää posti tulee kolme kertaa?!."; $from = "someonelse@example.com"; $headers = "from: $from" . "\r\n"; $headers .= "cc: kekkonen" . "\r\n"; mail($to,$subject,$message,$headers); echo "Viesti lähetetty."; ?> Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901731 Share on other sites More sharing options...
deansatch Posted August 19, 2009 Share Posted August 19, 2009 You don't refresh the page 3 times by any chance? Can we see the whole page? Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901738 Share on other sites More sharing options...
NaGGi Posted August 19, 2009 Author Share Posted August 19, 2009 Guess it somehow refreshed it 3 times since I moved the code to other place and it works just fine. Only one email coming now. Nothing wrong with the code then Quote Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901768 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.