Any method by which wen I send HTML mail through PHP s/w the receiver opens in HTML?

Discussion in 'PHP' started by Sakshi1102, Mar 30, 2012.

  1. #1
    Hi Everybody,

    I am having a problem. My company provide software by which the clients can send mails through their outlook using that software which is made in PHP.
    The problem is when they send the mail in HTML format , receivers are not able to open in HTML , they can open in text only format.
    So is there any software or any method by which this problem could be rectified. Please Help !!!

    Regards,
    Sakshi.
     
    Sakshi1102, Mar 30, 2012 IP
  2. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #2
    Either integrate a good mail class such http://www.redvodkajelly.com/code/php-email-class/. Or try the code below:

    <?php
        //change this to your email. 
        $to = "to@email.com"; 
        $from = "from@email.com"; 
        $subject = "Hello! This is HTML email"; 
    
        //begin of HTML message 
        $message = "<html> 
      <body bgcolor=\"#DCEEFC\"> 
            Some html content
      </body> 
    </html>"; 
       //end of message 
    
        // To send the HTML mail we need to set the Content-type header. 
        $headers = "MIME-Version: 1.0rn"; 
        $headers .= "Content-type: text/html; charset=iso-8859-1rn"; 
        $headers  .= "From: $from\r\n"; 
         
        // now lets send the email. 
        mail($to, $subject, $message, $headers); 
    
        echo "Message has been sent....!"; 
    ?>
    PHP:
     
    mfscripts, Mar 30, 2012 IP