Adding bold tag in php mail

To add bold text in a PHP mail, you can use HTML tags within the email body. Specifically, you can use the <b> tag to make text bold.

Here's an example:

<?php
  $to = '[email protected]';
  $subject = 'Bold Text Example';
  $message = '<b>This text will be displayed in bold</b>';

  $headers = 'MIME-Version: 1.0'. "\r\n";
  $headers.= 'Content-type: text/html; charset=UTF-8'. "\r\n";

  mail($to, $subject, $message, $headers);
?>

In this example, the $message variable contains the email body, which includes the <b> tag to make the text bold.

When the email is sent, the recipient's email client will render the HTML and display the text in bold.

Note that you need to set the Content-type header to text/html to indicate that the email body contains HTML content.

Alternatively, you can use the <strong> tag instead of <b>, as it is more semantic and recommended:

<?php
  $to = '[email protected]';
  $subject = 'Bold Text Example';
  $message = '<strong>This text will be displayed in bold</strong>';

  $headers = 'MIME-Version: 1.0'. "\r\n";
  $headers.= 'Content-type: text/html; charset=UTF-8'. "\r\n";

  mail($to, $subject, $message, $headers);
?>

Both of these approaches will achieve the same result: displaying bold text in the email body.