Jump to content


Photo

help! oh em gee


  • Please log in to reply
4 replies to this topic

#1 acidglitter

acidglitter
  • Members
  • PipPipPip
  • Advanced Member
  • 355 posts

Posted 22 September 2006 - 11:30 PM

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??
my makeup site <3
http://vanillaeyeliner.com

#2 honeyboy_20

honeyboy_20
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 22 September 2006 - 11:34 PM

<?php
// email address here
$to= "email@example.com";
// The subject
$subject = "Enter your subject here";
// The message
$message = "<b>Enter your message here</b><br>";
$from="your_email_here@test.com";
mail($to, $subject, $message, "From: $from");
?>


#3 acidglitter

acidglitter
  • Members
  • PipPipPip
  • Advanced Member
  • 355 posts

Posted 22 September 2006 - 11:37 PM

I meant like the message.. Everything sends alright but when I get the email it shows the codes in $crazy
my makeup site <3
http://vanillaeyeliner.com

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 23 September 2006 - 05:22 AM

Use the code i have provided you have to set the headers to get the mail to send proper html formated text ok.

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = '<b>put you code here ok</b>';
$headers =  'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 23 September 2006 - 05:48 AM

If you are going to send html in the email then you might want to use something like this.

<?php
$to = "someone@something.com";
$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 = "you@yoursite.com";//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";
}      
?>

Also, it is important to rember that you should keep the width of your tables to no more then 600.

Good Luck,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users