How does Gmail handle line breaks in emails sent through PHP scripts?

When sending emails through PHP scripts using Gmail, line breaks may not be displayed correctly due to differences in how Gmail handles line breaks compared to other email clients. To ensure proper line breaks in Gmail, use the PHP `nl2br()` function to convert newline characters into `<br>` tags before sending the email.

$message = &quot;Hello, this is a test email.\n\nThis is a new paragraph.&quot;;

// Convert newline characters to &lt;br&gt; tags for proper line breaks in Gmail
$message = nl2br($message);

// Send email using PHP&#039;s mail() function
mail(&#039;recipient@example.com&#039;, &#039;Subject&#039;, $message);