Link to home
Start Free TrialLog in
Avatar of asaidi
asaidi

asked on

html bold in php

Hi
$message_texte='<b>Report</b>:Daily'."\n\n".'<br><b>User</b> '.$surname;
i have this and i get email it shows this
<b>Report</b>:Daily

<br><b>User</b> Templemore Primary School
the b tag not working in the email ..the br tag is working..
any help please
SOLUTION
Avatar of darren-w-
darren-w-
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I dont see any reason for it to not work, just give a try with <strong> and check
Avatar of asaidi
asaidi

ASKER

Hi
my email part
 $email_expediteur='info@campion.ie';
     $email_reply='info@campion.ie';
     $message_texte='<b>Report</b>:Daily'."\n\n".'<br><b>User</b> '.$surname;

     $message_html='<html>
     <head>
     <title>Daily Report</title>
     </head>
    
     <body>Dear Customer<br>
         Please find attached your water usage report from the Net Water Watch monitoring system.<br>  
         The attached file is in PDF format if you do not have a reader this can be downloaded free of charge from www.abobe.com/reader.<br>
         If you have any problems with this email or any question on your report please feel free to contact us .
        </body>
    
     </html>';

     //-----------------------------------------------
     //GENERE LA FRONTIERE DU MAIL ENTRE TEXTE ET HTML
     //-----------------------------------------------

     $frontiere = '-----=' . md5(uniqid(mt_rand()));

     //-----------------------------------------------
     //HEADERS DU MAIL
     //-----------------------------------------------

     $headers = 'From :<'.$email_expediteur.'>'."\n";
     $headers .= 'Return-Path: <'.$email_reply.'>'."\n";
     $headers .= 'MIME-Version: 1.0'."\n";
     $headers .= 'Content-Type: multipart/mixed; boundary="'.$frontiere.'"';

     //-----------------------------------------------
     //MESSAGE TEXTE
     //-----------------------------------------------
     $message = 'This is a multi-part message in MIME format.'."\n\n";
     $message .= '--'.$frontiere."\n";
     $message .= 'Content-Type: text/plain; charset="iso-8859-1"'."\n";
     $message .= 'Content-Transfer-Encoding: 8bit'."\n\n";
     $message .= $message_texte."\n\n";

     //-----------------------------------------------
     //MESSAGE HTML
     //-----------------------------------------------
     $message .= '--'.$frontiere."\n";
     $message .= 'Content-Type: text/html; charset="iso-8859-1"'."\n";
     $message .= 'Content-Transfer-Encoding: 8bit'."\n\n";
     $message .= $message_html."\n\n";
     $message .= '--'.$frontiere."\n";

     //-----------------------------------------------
     //PIECE JOINTE
     //-----------------------------------------------

     $message .= 'Content-Type: application/pdf; name=$surname'.'.pdf'."\n";
     $message .= 'Content-Transfer-Encoding: base64'."\n";
     $message .= 'Content-Disposition:attachement; filename='.$surname.'.pdf'."\n";

     $message .= chunk_split(base64_encode(file_get_contents($surname.'.pdf')))."\n";

     if(mail($email,'Daily Report',$message,$headers))
     {
          echo 'Mail was sent to  '.$email.'<br/>';
     }
     else
     {
          echo 'mail failed...';
     }
  

Open in new window

The bold you are using is before <html> tag, thats the problem
SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial