I am building a website form page where a user enters in information which gets sent to my email once submitted. This appears to work ok, however, I want the information to be displayed in bullet points within the email once it has been sent.
Below shows the bit of code that sends all the information in one big chunk, but how do I add bullet points from each title i.e. company name, email, phone number etc? or even a line space is fine…
Code:
$to = 'bla@hotmail.com';
$subject = 'Quote';
$message = 'FROM: '.$companyname. '-' .$fullname. 'Email: '.$email. ' Phone Number: '.$phonenumber;
$headers = 'From: bla@hotmail.com' . "\r\n";
Expected Outcome:
Company Name:
Full Name:
Email:
Phone Number:
To send the list with formatting (or format text in general) you’ll have to use HTML.
So,
$headerswill become:$headers = 'From: bla@hotmail.com' . "\r\nContent-type: text/html\r\n";to tell the client this mail is HTML and not plain text.
Then, the message will be
See also “Example #4 Sending HTML email” here