soscopyrights Posted August 13, 2006 Share Posted August 13, 2006 hi guys... recently I grabbed an php/mysql book. i'm on the php mail chapter. my goald is this:to do a tell-a-friend page(html- which I made) and the php part. Now... I managed to receive messages, on my mail, but I'd like to include HTML into that "tell a friend" result...u know... subject..." SOS wants you to check out this website!" and the content in HTML. I know I'm kinda' noob, but I'm trying my best...[code]<?php$content="html";mail($to,strtoupper($subject),$content,$from);?>[/code]You realise the code is incomplete...I've been hearing something about MIME....which I don't know what's about...pls have a bit patience and inlight me... Thank you. Quote Link to comment Share on other sites More sharing options...
omerta Posted August 24, 2006 Share Posted August 24, 2006 Suppose you have this variable from a form..$friend_email[code]// Sending an html mail // Your recipient $to = ($_GET['friend_email']); // subject $subject = 'Tell A Friend'; // message $message = 'HTML CODE'; // Insert your html code here// 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 .= 'From: Your Site Name <admin@yoursite.com>' . "\r\n"; // Mail it mail($to, $subject, $message, $headers);[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.