I’m having trouble making my e-mail look better, such as with CSS because it looks like plain text:
Is there anyway to bold or something with html? I’ve tried concat with <b>
tags but I don’t think it works because I’m assigning a variable. How can I make it look better? I’m using WordPress.
Also how can I make it File Upload compatible? Thanks
Here’s (part) of my code:
<?php
$message = "You have received a message from " . $fullname . ", See information below:" . "n" .
"nn" . "General:" . "n" .
"nFull Name: " . $fullname . "n" .
"nEmail Address: " . $email . "n" .
"nSubject: " . $Subject . "n" .
"nIssue Type: " . $issuetype . "n" .
"nn" . "Hardware:" . "n" .
"nOrder Number: " . $ordernumber . "n" .
"nOrder Date: " . $orderdate . "n" .
"nPhoto: " . $photo;
//php mailer variables
$to = get_option('admin_email');
$subject = "Customer Support Form Subject: " . $Subject . " By " . $fullname;
$headers = 'From: '. $email
?>
<?php
if($_POST["submit"]){
$sent = wp_mail($to, $subject, $message, $headers);
}
?>
It seems you’re using wordpress and using wp_mail to send the email. The default content-type based on the wordpress codex page
is text/plain. with that said you won’t be able to add styling to it unless you change the content type to text/html using wp_mail_content_type filter or add it to your $headers variable.
Notice that I changed the
n
to<br />
and added additional header ($headers = 'Content-type: text/html;charset=utf-8' . 'rn';
) to set the content type.Regarding adding attachments please check this post.
https://wordpress.stackexchange.com/questions/50264/using-wp-mail-with-attachments-but-no-attachments-received