I can't figure out why this script sends two copies instead of one. Is there a problem with the script? Is there something wrong with my server? Thanks!
<?php
$email = "
[email protected]";
$from = "
[email protected]";
$subject = "subject";
$message = "message";
function mail_attach($to, $from, $subject, $message) {
$header = "From: ".$from."\r\n";
$header.= "To: ".$to."\r\n";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-Type: multipart/mixed;\r\n";
$header.= " boundary=\"".$mime_boundary."\"\r\n";
$header.= "Return-Path:<
[email protected]>\r\n";
$content.= $message."\r\n";
mail($to, $subject, $content, $header);
}
mail_attach( $email, "
[email protected]", "$subject", "$message");
?>