Jump to content

help! oh em gee


acidglitter

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.