| Current Path : /home2/wtmwscom/www/member/ |
| Current File : /home2/wtmwscom/www/member/invite_model.php |
<?php
session_start();
include '../connection.php';
include '../function_lib.php';
if(!isset($_SESSION['userid']) || empty($_SESSION['userid'])){ redirect("../login.php");}
$uid = $_SESSION['userid'];
if(isset($_POST['emails'])){
$fes = explode(", ", $_POST['emails']);
foreach ($fes as $key => $email){
if(filter_var($email, FILTER_VALIDATE_EMAIL)){
invite($email, $uid);
setMessage('Email sent successfully', 'alert-msg success');
}
else{
setMessage('Failed, Some error occured', 'alert-msg error');
redirect('./invite.php');
}
}
}
redirect('./invite.php');
function invite($email, $uid){
$to = $email;
$subject = "Best Helping";
$txt = '
<html>
<head>
<style type="text/css">
table{width:700px; border-collapse:collapse; table-layout:auto; vertical-align:top; margin-bottom:15px; border:1px solid #CCCCCC;}
table thead th{color:#FFFFFF; background-color:#666666; border:1px solid #CCCCCC; border-collapse:collapse; text-align:center; table-layout:auto; vertical-align:middle;}
table tbody td{vertical-align:top; border-collapse:collapse; border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC;}
table thead th, table tbody td{padding:5px; border-collapse:collapse;}
table tbody tr.light{color:#666666; background-color:#F7F7F7;}
table tbody tr.dark{color:#666666; background-color:#E8E8E8;}
</style>
</head>
<body>
<table>
<thead>
<th colspan="2" style="text-align: center;">flexyclub.net</th>
</thead>
<tbody>
<tr class="light">
<td colspan="2" align="center">' . get_user($uid).'</td>
</tr>
<tr class="dark">
<td colspan="2" align="left">
Hi,<br><br>
Click here to join : <a href="http://www.flexyclub.net/register.php?uid='.$uid.'">Best Helping</a><br><br>
Cheers,<br>
' . get_user($uid) . '
</td>
</tr>
<tr class="light">
<td colspan="2" align="center">For any query contact us : info@flexyclub.net</td>
</tr>
<tr class="dark">
<td colspan="2" align="center">Visit Us : <a title="www.flexyclub.net" href="http://flexyclub.net">flexyclub.net</a></td>
</tr>
</tbody>
</table>
</body>
</html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: info@flexyclub.net";
mail($to,$subject,$txt,$headers);
}
?>