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? 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 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. 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 = "[email protected]"; $subject = "Postin aihe"; $message = "sähköpostin viesti mutta miks tää posti tulee kolme kertaa?!."; $from = "[email protected]"; $headers = "from: $from" . "\r\n"; $headers .= "cc: kekkonen" . "\r\n"; mail($to,$subject,$message,$headers); echo "Viesti lähetetty."; ?> 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? 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 Link to comment https://forums.phpfreaks.com/topic/170962-solved-weird-mail-problem/#findComment-901768 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.