Problem sending mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
QbertsBrother
Forum Commoner
Posts: 58
Joined: Thu Oct 11, 2007 10:12 am

Problem sending mail

Post by QbertsBrother »

i have a script that sends an email. there is no problem sending the mail but the problem is in the formating of the email.

i am trying to put some line breaks in the email and it dosent seem to work. can someone look at this code and maybe inform me as to why the line breaks are not happening. it is weird and i have done it in the past. could it be something on the server?

thanks

Code: Select all

 
$to = 'email@email.net';
 
$subject = 'Temporary Employee Parking Permit Application';
 
$message = "A parking permit application has been completed:\n\n";
$message .= "$business_name\n\n";
$message .= "$first_name $last_name\n\n";
$message .= "Make/Model: $makemodel\n\nLicense #: $license\n\n";
$message .= "Start Date: $startdate\n\nEnd Date: $enddate";
 
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: ME <email@email.com>' . "\r\n";
$headers .= 'From: Website <email@email.net>' . "\r\n";
 
mail($to, $subject, $message, $headers);
 
QbertsBrother
Forum Commoner
Posts: 58
Joined: Thu Oct 11, 2007 10:12 am

Re: Problem sending mail

Post by QbertsBrother »

nevermind i figured it out. it was the headers that i was sending along with it.
Post Reply