Hi there . I have got my code all setup the way i want but I wish to have the body messages come up bold..
here is my code
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_text1'];
$field_message2 = $_POST['cf_text2'];
$field_message3 = $_POST['cf_text3'];
$mail_to = 'ruscal@orcon.net.nz';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .='If you have a written employment agreement,
what is the name of the employer as written in that agreement:'.$field_message;
$body_message .= 'If you dont have a written employment agreement,
what is the name(s) that appear on your bank statement as paying your wages/salary: '.$field_message2;
$body_message .= 'If you dont have a written employment agreement or are not sure who pays your wages/salary,
who do you think is your employer: '.$field_message3;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'employee.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to ruscal@orcon.net.nz');
window.location = 'employee.html';
</script>
<?php
}
?>
I am wanting to space out the email and also add bold to the follow lines;
'If you have a written employment agreement,
what is the name of the employer as written in that agreement:
If you dont have a written employment agreement,
what is the name(s) that appear on your bank statement as paying your wages/salary: '
'If you dont have a written employment agreement or are not sure who pays your wages/salary,
who do you think is your employer: '
at the moment the email is coming out like so;
From: asdasd
E-mail: ruscal@orcon.net.nz
If you have a written employment agreement,
what is the name of the employer as written in that agreement:asdasdasdIf you dont have a written employment agreement,
what is the name(s) that appear on your bank statement as paying your wages/salary: asdasdasdIf you dont have a written employment agreement or are not sure who pays your wages/salary,
who do you think is your employer: asdasdasd
Thanks,
Page 1 of 1
contact form
#2
Posted 23 January 2012 - 12:51 PM
Why not set the message up for HTML that way you could style it anyway you want.
Add this to you headers:
and the start your $body_message with
and finish with
then simply add <b></b> around the text requiring styling
Add this to you headers:
$headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
and the start your $body_message with
$body_message = '<html><body>';
and finish with
$body_message .= '</body></html>';
then simply add <b></b> around the text requiring styling
#3
Posted 23 January 2012 - 10:37 PM
websiteprodigy, on 23 January 2012 - 12:51 PM, said:
Why not set the message up for HTML that way you could style it anyway you want.
Add this to you headers:
and the start your $body_message with
and finish with
then simply add <b></b> around the text requiring styling
Add this to you headers:
$headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
and the start your $body_message with
$body_message = '<html><body>';
and finish with
$body_message .= '</body></html>';
then simply add <b></b> around the text requiring styling
theres no need to add <html><body></body></html> gotta remember any email client the message is gonna appear in these tags are already open
- ← What's wrong with this PHP code?
- Server Side (PHP, Databases, ASP.NET, etc)
- Contact form email option box for php →
Share this topic:
Page 1 of 1
Help















