I am trying to figure out how to use PHPMailer to send me the file attachments from
http://houstonasp.com/php/ in an email as Attachments using this.
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "houstonasp.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "admin@houstonasp.com"; // SMTP username
$mail->Password = "ccc"; // SMTP password
$mail->FromName = "Website";
$mail->AddAddress("test@yahoo.com", "Administrator");
$mail->WordWrap = 50;
$mail->IsHTML(true);
// set email format to HTML
foreach($_FILES as $key1 => $value1){
//$key1 is the fileinput name
foreach($value1 as $key2=>$value2){
if($key2=='tmp_name'){
$mail->AddAttachment($_FILES[$key1][$key2], 1001, $_FILES[$key1]['name']);
}
}
}
$mail->Subject = "Photos";
$mail->Body = "Photos for <b>in bold!</b>";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
And all i get is
Photos for <b>in bold!</b>
and no attachments!
Can I get help please?