The to email id will be added from contact address from his ids (yahoo, gmail etc)
1. I want the clients to export their address form their accounts and in my form i am reading that file and generate checkboxes against each email ids where they check and submit.
For yahoo and gmail, it worked fine. But i am not able to do the same for msn.
Below is the code for yahoo and gmail,
Code: Select all
$file_tmp=file($_FILES['file']['tmp_name']);
$domain=$_POST['domain'];
if($domain=='gmail')
{
$table="<form method='post' action='contact.php?process=submit'><table border=1 width='20%' align='center'>";
foreach($file_tmp as $file_tmp)
{
$exp=explode(',', $file_tmp);
if($exp[0] !='Name' && $exp[1] !='E-mail')
$table.="<tr><td> $exp[0] </td> <td> $exp[1] </td> <td><input type='checkbox' name=email_id[] value=$exp[1]></td></tr>";
}
echo $table.="<tr><td align='center' colspan='3'><input type='submit' name='submit' value='submit'></td></tr></table> </form>";
}
elseif($domain=='yahoo')
{
$table="<form method='post' action='contact.php?process=submit'><table border=1 width='20%' align='center'>";
foreach($file_tmp as $file_tmp)
{
$exp=explode(',', $file_tmp);
$first_name=ereg_replace('"', "", $exp[0]); $middle_name=ereg_replace('"', "", $exp[1]);
$last_name=ereg_replace('"', "", $exp[2]); $email_id=ereg_replace('"', "", $exp[4]);
if($first_name !='First' && $middle_name !='Middle' && $last_name !='Last' && $email_id !='Email')
$table.="<tr><td> $first_name $middle_name $last_name </td> <td> $email_id </td> <td><input type='checkbox' name=email_id[] value=$email_id></td></tr>";
}
echo $table.="<tr><td align='center' colspan='3'><input type='submit' name='submit' value='submit'></td></tr></table> </form>";
}