';
if($_POST['email_to'])
{
$email_to=trim($_POST['email_to']);
$email_na=trim($_POST['name_to']);
$fn='outgoing/NewEmailList.snd.txt';
// if (! file_exists($fn))
// {
// echo 'File:'.$fn.'<- not located.';
// }
// else
// {
$append='Y';
$file = fopen($fn, "a+") or exit("Unable to open file: ".$fn);
while(!feof($file))
{
$xlin=trim(fgets($file));
if (stripos($xlin,';')>-1)
{
$xlin=substr($xlin,0,stripos($xlin,';'));
}
if (stripos($xlin,',')>-1)
{
$xlin=substr($xlin,0,stripos($xlin,','));
}
if($email_to==$xlin)
{
$append='N';
}
}
fclose($file);
if($append=='Y') // not found
{
// encode
$nemail_to=mvchr($email_to);
$nemail_na=mvchr($email_na);
$efrom = $compfull.' <'.$replyemail.'>';
$bcc_to="";
$cc_to="";
$subject='Confirmation from '.$compfull;
$message='A confirmation request has be sent to this email address from '.$compfull.'
If you have made a request to add your email address to '.$compfull.' please click the confirmation link below.
';
//191
$message.='I confirm the addition of my email address to '.$compfull.'
'.chr(13).chr(10);
$message.='
You may unsubscribe by clicking the unscuscribe/remove me link at the bottom portion of any email you receive from '.$compfull;
$message.='
If you have not submitted your email address to '.$compfull.', please disregard this email.';
//$message.='
'.$compfull;
//text
//$aheader = 'MIME-Version: 1.0' . "\r\n";
//html
$aheader = 'MIME-Version: 1.0' . "\r\n";
$aheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$eheader=$aheader."From: ".$efrom.chr(13).chr(10)."Cc: ".$cc_to.chr(13).chr(10)."Bcc: ".$bcc_to ;
if ($email_to!=="" && stripos($email_to,'@')>1)
{
mail($email_to, "$subject", $message, $eheader );
}
//fwrite($file, $_POST['email'].chr(13).chr(10));
}
//fclose($file);
echo '
';
if($append=='Y')
{
echo 'An email was sent to the email address your provided and should arrive to you within a few minutes.
Please check your email for a confirmation notice from '.$compfull.'.
After clicking the confirmation link within this email, your address should then be added. - Thank You!';
}
else
{
echo 'Email Address was already added. Thank you!';
}
echo ' ';
echo '
';
echo 'You may close this window now.';
echo '
';
echo '
(OR)';
echo '
';
echo 'Add Another';
echo '
';
// echo '';
// }
}
else
{
echo '';
// echo 'Please add my email address from your email lists.
';
echo '';
echo '
';
echo '';
echo '
';
}
?>
Copyright 2010