Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Mail with Attachment sending twice!

4:44 pm on Feb 6, 2014 (gmt 0)

Full Member

5+ Year Member

joined:Oct 19, 2011
posts: 201
votes: 1

Can anyone tell me why this script might send the mail out twice?

if (@mail($recipient, $subject, $message, $headers))

echo "Thank You! We will Contact You When We Have An Opportunity Requiring Your Skills-<br />";
echo"You will be redirected back to the employment page in 10 seconds...";
echo'<meta http-equiv="refresh" content="10;url=employment2.php">';


echo"<h1>Error ! Unable to send Mail..</h1>";


It does work, but it sends the same mail twice.

Prior to this, I do have some security:

$loadtime = $_POST['loadtime'];
$checkbox = $_POST['antispam'];
$robotest = $_POST['robotest'];
$totaltime = time() - $loadtime;

if($totaltime < 7) {
echo("Please fill in the form before submitting!");
echo'<meta http-equiv="refresh" content="5;url=employment2.php">';

elseif($robotest != "" && $checkbox = " ")
echo "Please refrain from SPAMMING!";


echo $checkbox;
echo"Go back and click on the check box please.";
echo'<meta http-equiv="refresh" content="10;url=employment2.php">';

else {

Too many nested else statements?
Thanks for any help!
5:42 pm on Feb 6, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 12, 2002
votes: 0

Tough to tell without seeing the whole code.

But, what do you have for $recipient, could the email be repeated here?

i.e. $recipient = 'email@example.com, email@example.com';
8:44 pm on Feb 6, 2014 (gmt 0)

Full Member

5+ Year Member

joined:Oct 19, 2011
votes: 1

I actually found the problem; I had two duplicate send lines.
9:31 pm on Feb 6, 2014 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
votes: 846

... and that's why Technical Support asks if the computer is plugged in :)

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members