Connecting Tech Pros Worldwide Help | Site Map

phpmail and attachments

p cooper
Guest
 
Posts: n/a
#1: Aug 11 '06
Im trying to send an email + attachment from a linux box on my desk,
through the exchange server at work

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->SetLanguage("en", "/usr/lib/php/");
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "10.138.0.5"; // Exchange server
$mail->From = "John.Doe";
$mail->AddAddress("John.Doe");
$mail->Subject = "CCMDS form";
$mail->Body = "CCMDS form";
$mail->WordWrap = 50;
#$mail->AddAttachment("/tmp/fpdf.pdf");
if(!$mail->Send())
{ echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;}
else
{ echo "Message has been sent";}



works as long as the attachment isnt added - as soon as I uncomment the
AddAttachment line I get the 'message' sent but nothing appears at the
other end and I get no bounce/error message

anyone know whats wrong ?

Closed Thread