acidglitter Posted September 22, 2006 Share Posted September 22, 2006 You know the mail() function? I'm using it like this...mail("email", "subject","$crazy","From: me <email\n");$crazy = all these html things.. But when I get the message, it puts things like (b) instead of actually being bold.. How can I make it show up right instead of showing the code?? Link to comment https://forums.phpfreaks.com/topic/21731-help-oh-em-gee/ Share on other sites More sharing options...
honeyboy_20 Posted September 22, 2006 Share Posted September 22, 2006 [code]<?php// email address here$to= "[email protected]";// The subject$subject = "Enter your subject here";// The message$message = "<b>Enter your message here</b><br>";$from="[email protected]";mail($to, $subject, $message, "From: $from");?>[/code] Link to comment https://forums.phpfreaks.com/topic/21731-help-oh-em-gee/#findComment-97015 Share on other sites More sharing options...
acidglitter Posted September 22, 2006 Author Share Posted September 22, 2006 I meant like the message.. Everything sends alright but when I get the email it shows the codes in $crazy Link to comment https://forums.phpfreaks.com/topic/21731-help-oh-em-gee/#findComment-97017 Share on other sites More sharing options...
redarrow Posted September 23, 2006 Share Posted September 23, 2006 Use the code i have provided you have to set the headers to get the mail to send proper html formated text ok.[code]<?php$to = '[email protected]';$subject = 'the subject';$message = '<b>put you code here ok</b>';$headers = 'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);?> [/code] Link to comment https://forums.phpfreaks.com/topic/21731-help-oh-em-gee/#findComment-97128 Share on other sites More sharing options...
tomfmason Posted September 23, 2006 Share Posted September 23, 2006 If you are going to send html in the email then you might want to use something like this. [code]<?php$to = "[email protected]";$subject = "Something";$message = "<html><head><title>Something</title></head><body><table width="600"> <tr> <td>You can put something<b>here</b></td> </tr></table></body></html>";$knownsender = "[email protected]";//make sure that this an email address that is known to the server$headers = "FROM: $knownsender\r\n";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-type: multipart/alternative;\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";$headers .= "Content-Transfer-Encoding: 7bit";$headers .= "\r\n";if (mail($to, $subject, $message, $headers)) { echo "Your mail was sent to $to";}else{ echo "Unable to send the message";} ?>[/code]Also, it is important to rember that you should keep the width of your tables to no more then 600.Good Luck,Tom Link to comment https://forums.phpfreaks.com/topic/21731-help-oh-em-gee/#findComment-97132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.