Jump to content

Archived

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

soscopyrights

...by the book: html "tell a friend"-php mail

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

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.