I am using the code to send an html email (phpmailer class) now I need to 
somehow determine if the recipient uses text only email and change email to 
plain. Is this possible?


    include( 'html_emails/html2.php' );
    $mail_body = ob_get_contents();
    ob_end_clean();

include("../mailer/class.phpmailer.php");

$mail = new PHPMailer();
$mail->Mailer = "mail";
$mail->IsHTML(true);
$mail->Host = "imap.1and1.co.uk";
$mail->FromName = "Legal Services UK";
$mail->From = "xxxxx.";
$mail->Sender = "xxxxx>";
$mail->Subject = $_POST['mail_subject'];



 $mail_to = $_POST['mail_to'];
 $addresses = array();
$addresses = explode(",", $mail_to);


$mail->AddAttachment($userfile, $_FILES['userfile']['name']);
$mail->Subject = $_POST['mail_subject'];
$mail->Body =$mail_body;
$mail->WordWrap = 50;

for($i = 0; $i < count($addresses); $i++)
{
     $mail->AddAddress($addresses[$i]);
     if(!$mail->Send())
     {
        echo "Message was not sent";
        echo "Mailer Error: " . $mail->ErrorInfo;
     }
    $mail->ClearAddresses();
 ?>
 <script type="text/javascript">
<!--
alert('Your email was sent successfully');
window.location = "index.php"
//-->
</script>

 <?php
}


 } 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to