Jump to content

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


soscopyrights

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.
Link to comment
Share on other sites

  • 2 weeks later...
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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.