IsSMTP(); // set mailer to use SMTP if ($tmp_smtpauth == "true") { $mail->SMTPAuth = $tmp_smtpauth; // turn on/off SMTP authentication } $mail->Host = $tmp_smtphost; if (strlen($tmp_smtpsecure)>0) { $mail->SMTPSecure = $tmp_smtpsecure; } if ($tmp_smtpusername) { $mail->Username = $tmp_smtpusername; $mail->Password = $tmp_smtppassword; } $mail->SMTPDebug = 2; echo "tmp_smtpfrom: $tmp_smtpfrom\n"; echo "tmp_smtpfromname: $tmp_smtpfromname\n"; echo "tmp_subject: $tmp_subject\n"; $mail->From = $tmp_smtpfrom; $mail->FromName = $tmp_smtpfromname; $mail->Subject = $tmp_subject; $mail->AltBody = $tmp_textplain; // optional, comment out and test $mail->MsgHTML($tmp_texthtml); $tmp_to = $faxemail; $tmp_to = str_replace(";", ",", $tmp_to); $tmp_to_array = split(",", $tmp_to); foreach($tmp_to_array as $tmp_to_row) { if (strlen($tmp_to_row) > 0) { echo "tmp_to_row: $tmp_to_row\n"; $mail->AddAddress($tmp_to_row); } } if (strlen($faxname) > 0) { $mail->AddAttachment($dir_fax.$faxname.'.tif'); // tif attachment $mail->AddAttachment($dir_fax.$faxname.'.pdf'); // pdf attachment $mail->AddAttachment($dir_fax.$faxname.'.png'); // png attachment //$filename='fax.tif'; $encoding = "base64"; $type = "image/tif"; //$mail->AddStringAttachment(base64_decode($strfax),$filename,$encoding,$type); } if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } $content = ob_get_contents(); //get the output from the buffer ob_end_clean(); //clean the buffer fwrite($fp, $content); fclose($fp); ?>