us3r4it Posted March 27, 2012 Share Posted March 27, 2012 Would you please help me to fix the problem of sending two emails instead of just one every time I run the following code using this url: http://domain.org/image.php?path=dir/file.jpg <?php $email="[email protected]"; $body = "the body"; $subject="the subject"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Image Visit Receipt <[email protected]>' . "\r\n"; mail($email,$subject,$body,$headers); if ($HTTP_GET_VARS["path"]) { $imagepath="/home2/mydomain/public_html/files/images/".$HTTP_GET_VARS["path"]; if (file_exists($imagepath)) { $image=imagecreatefromjpeg($imagepath); header('Content-Type: image/jpeg'); imagejpeg($image); exit; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/259795-double-email-problem/ 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.