Author Topic: PHP Mail  (Read 350 times)

0 Members and 1 Guest are viewing this topic.

Offline alex

  • Global Moderator
  • *****
  • Posts: 35
  • Karma: +11/-0
PHP Mail
« on: January 24, 2010, 04:17:27 PM »
Code: [Select]
<?php
$email
="example@example.com";
$subject="My Subject";
$body="My Body";
$from="info@example.com";
mail($email$subject$body"FROM: $from");
?>
Code: [Select]
//php mail with HTML
<?php
$email
="example@example.com";
$subject="My Subject";
$body ='
<HTML>
<head>
<style>
body
{
background-color: #0000CC;
margin-left:  10em;
margin-top: 1em;
font-family: "Trebuchet MS";
font-size:   24px;
color:    "#FFFFFF";
}
</style>
</head>
<body>
My HTML Mail
</body> '
;
$headers='MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' "\r\n";
$headers .= 'From: System <noreply@example.com>' "\r\n";
mail($email$subject$body$headers);
?>