mail function sends email twice
Posted: Thu Mar 13, 2008 3:38 pm
i'm new to php, and this is my first real script. it allows users to upload an image, and then it emails me telling me that something has been uploaded.
here's the part of my script that deals with email (with a fake address and website):
$newname is defined in the upload part of the script:
everything works fine, except i get one email with a link to just the folder (http://www.awebsite.org/content/) and a second email with the full link (http://www.awebsite.org/content/gallery/image.jpg)
any idea as to what's going wrong? i have a feeling it's a syntax error or something. thanks!
here's the part of my script that deals with email (with a fake address and website):
Code: Select all
// Setting up the email
$pfw_subject = "New file uploaded to server";
$pfw_email_to = "user@address.com";
$pfw_message = "A new picture has been uploaded to the gallery. In order for it to appear, you must approve it first:\n"
. "Link: http://www.awebsite.org/content/$newname\n";
mail($pfw_email_to, $pfw_subject ,$pfw_message) ;
?>Code: Select all
// Unique name
$image_name=time().'.'.$extension;
// Store in gallery folder
$newname="gallery/".$image_name;any idea as to what's going wrong? i have a feeling it's a syntax error or something. thanks!