Are there specific guidelines or best practices for writing email content to avoid spam filters?

When writing email content to avoid spam filters, it is important to avoid using spam trigger words, excessive punctuation, and all caps text. Additionally, including relevant and personalized content, properly formatting the email with HTML and text versions, and avoiding excessive use of images can help improve deliverability.

// Example PHP code snippet for sending email with proper content to avoid spam filters
$to = "recipient@example.com";
$subject = "Important Message";
$message = "Hello, [Recipient Name]. We hope this email finds you well. Please find attached the document you requested. Thank you.";
$headers = "From: sender@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

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