phpmail and attachments

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • p cooper

    phpmail and attachments

    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("e n", "/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("Jo hn.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 ?

Working...