How can you concatenate strings in PHP to properly format the message in the email?

When sending an email in PHP, you may need to concatenate strings to properly format the message. To concatenate strings in PHP, you can use the dot (.) operator to combine multiple strings together. This allows you to create a well-formatted message by combining variables, text, and HTML elements as needed.

// Example of concatenating strings to format an email message
$emailMessage = "Hello " . $recipientName . ",\n\n";
$emailMessage .= "Thank you for your inquiry. Here is the information you requested:\n\n";
$emailMessage .= "Product Name: " . $productName . "\n";
$emailMessage .= "Price: $" . $productPrice . "\n\n";
$emailMessage .= "If you have any further questions, feel free to contact us. \n\n";
$emailMessage .= "Best regards,\nYour Company Name";

// Send the email with the concatenated message
mail($recipientEmail, "Your Inquiry Information", $emailMessage);