Wednesday, April 21, 2010

Simple Email Script

<?php
//User Tracking Email to administrator
function usertrack($audio_url,$audio_title,$autoplay)
{
$toaddress = "test@gmail.com";
$date_time = date("d-m-Y H:i:s");
$subject = 'Test msg....';
// Html Page message
$message = "
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd >
<html xmlns= http://www.w3.org/1999/xhtml >
<head>
<meta http-equiv= Content-Type content= text/html; charset=iso-8859-1 />
<title>The Team</title>
<style type= text/css >
<!--
.style1 {
color: #CC0066;
font-weight: bold;
}
.style2 {color: #FF00FF}
-->
</style>
</head>
<body>
<table width= 630 border= 0 cellpadding= 0 cellspacing= 0 >
<tr>
<td height= 21 valign= top > </td>
</tr>
<tr>
<td height= 46 valign= top ><strong>Hi Admin , </strong></td>
</tr>
<tr>
<td height= 76 valign= top ><table width= 100% border= 0 cellpadding= 0 cellspacing= 0 >
<tr>
<td width= 28 height= 76 valign= top > </td>
<td width= 602 valign= top >
<b>URL Of where your mp3 is located:</b> ".$audio_url." <br>
<br>
<b>Text to display:</b> ".$audio_title." <br>
<br>
<b>Auto Play:</b> ".$autoplay."<br>
<br>
</td>
</tr>
</table> </td>
</tr>
<tr>
<td height= 15 valign= top > </td>
</tr>
<tr>
<td height= 71 valign= top >
<span class= style2 >The Team! <br /><a href='http://www.gmail.com' target='_blank'>www.gmail.com</a>
<br />
</span></td>
</tr>
</table>
</body>
</html>";

//echo $message;
$headers = 'MIME-Version: 1.0'. "\n";
$headers.='Content-type: text/html; charset=iso-8859-1'."\n";
$headers.='From: The Team <support@gmail.com>'."\n";
mail($toaddress, $subject, $message,$headers);
}

if( (isset($_POST['url'])) && (isset($_POST['title'])) && (isset($_POST['autoplay'])) )
{
$flash_width = strlen($_POST['title'])*12;
$flash_width += 75;
$script="http://server01/test/audioplayer.php?";
$script .="audiourl=".$_POST['url']."&";
$script .="audiotitle=".$_POST['title']."&";
$script .="autoplay=".$_POST['autoplay'];
//echo $script;
$html ="<p align='center'><iframe src='".$script."' width='".$flash_width."' height='85' align='middle' scrolling='no' frameborder='0'></iframe></p>";
usertrack($_POST['url'],$_POST['title'],$_POST['autoplay']);
}
?>

No comments:

Post a Comment