casey_00 Posted April 12, 2007 Share Posted April 12, 2007 ??? What would i have to add to be able to place proper html in this email... eg adding tables etc... when i add a table it has a heart attack... anyone know why? $lang['message_read']['html'] = "Dear #FirstName#,<br><br>The message you sent to '#RecipientName#' has been read.<br><br>Good Luck!<br>#AdminName#"; Link to comment https://forums.phpfreaks.com/topic/46708-tables-in-email-and-crashing/ Share on other sites More sharing options...
jitesh Posted April 12, 2007 Share Posted April 12, 2007 <?php // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= '[email protected]'; // subject $subject = 'Birthday Reminders for August'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n"; $headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/46708-tables-in-email-and-crashing/#findComment-227536 Share on other sites More sharing options...
casey_00 Posted April 12, 2007 Author Share Posted April 12, 2007 this is all automated, so the to: and subject are automatically added, so basically in my php file i have a list of them... currently this works... but i want to add tables to it to make it a better layout... but when i add the tables it has a fit and doesnt like table width etc... can i write table in a different way apart from <table width 200 etc... as i said the below code works fine... but want to add more to it /* HTML emails */ $lang['message_viewed']['html'] = 'Dear #FirstName#,<br><br>This is an automatic notification to inform you that your message to #RecipientName# on #siteName# has been viewed by the user. Come visit us at <a href=\"#link#\">#siteName#</a>.<br><br>Good Luck!<br>#AdminName#'; $lang['profile_activated']['html'] = "Dear #FirstName#,<br><br>This is an automatic notification to inform you that your profile on #siteName# has been activated with the membership level of #MembershipLevel#. Come visit us soon at <a href=\"#link#\">#siteName#</a>.<br><br>Good Luck!<br>#AdminName#"; Link to comment https://forums.phpfreaks.com/topic/46708-tables-in-email-and-crashing/#findComment-227538 Share on other sites More sharing options...
casey_00 Posted April 13, 2007 Author Share Posted April 13, 2007 anyone else know? Link to comment https://forums.phpfreaks.com/topic/46708-tables-in-email-and-crashing/#findComment-228114 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.