'Y' ) and (`Accepted` <> 'Y') order by ID "; $result = MySQL($dbName,$SelectStr) or die(mysql_error()); $counter=0; while($myrow=MySQL_fetch_array($result)){ $counter++; //see if user is on the dont send email list $lookupEmail = $myrow["EMAIL"]; include "doNotSend.php"; //end of email lookup - result will be $OkToSendEmail = Y or N $theLink = "http://yadahome.com/signUpProcess.php?rndid=" . $myrow["Random_Key"] . "&invid=" . $myrow["ID"] ; $to = $myrow["EMAIL"]; $rand_key = $myrow["Random_Key"]; $lastInvId = $myrow["ID"]; $inviterID = $myrow["USER_ID"]; //GET SENDERS NAME $SelectStr2 = "SELECT * FROM users WHERE ID = '" . $myrow["USER_ID"] . "'"; $result2 = MySQL($dbName,$SelectStr2) or die(mysql_error()); IF($myrow2=MySQL_fetch_array($result2)){ $USERLNAME = $myrow2["Last_Name"]; $USERFNAME = $myrow2["First_Name"]; $senderEmail = $myrow2["Email"]; $theGender1 = "they"; $theGender2 = "his or her"; $theGender1C = "They"; if($myrow2["Gender"] == "f"){ $theGender1 = "she"; $theGender1C = "She"; $theGender2 = "her";} if($myrow2["Gender"] == "m"){ $theGender1 = "he"; $theGender1C = "He"; $theGender2 = "his";} } $fromName = $USERFNAME . " " . $USERLNAME; $fromNameEmail = $USERFNAME . $USERLNAME; $from = "$fromNameEmail@YadaHome.com"; //$fromNamePoss = $_SESSION["sessionFname"] . "'s"; include "emailTerms.php"; $subject = "Take A Look At My Profile On A Great New Website I Discovered!"; $greeting = "Hi,

"; if ( $myrow["Fname"] > " "){ //$subject = ucwords($myrow["Fname"]) . ", join my network!"; $greeting = "Hi " . $myrow["Fname"] . ",

"; } //begin email message $message = " $subject

" . $greeting . " I've been using YadaHome, a great new website I recently discovered. It has lots of useful features including free organizational tools like shared grocery lists, to do lists, photos, and calendars. Plus, you can network with family and friends! It's free to join, and it would be great to add you to my new network!

Thanks!

$fromName

Check out my YadaHome profile here: http://yadahome.com/profileLimited.php?fid=$inviterID

Get your own free profile here: $theLink

Take a quick tour of YadaHome.com and see all of their cool features here: http:yadahome.com




-----------------------------------------------------
$emailTermsInvitation
"; //end of message $headers = "From: $from\r\n"; $headers .="Reply-To: $senderEmail \r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]"; //$headers .= "Bcc: [email]email@maaking.cXom[/email]"; // now lets send the email. if($OkToSendEmail == "Y"){ //echo "okto send"; //********************************************************** mail($to, $subject, $message, $headers); //********************************************************** } //echo "to: $to
from: $headers
subject: $subject
message: $message"; echo "to: $to
from: $headers
subject: $subject
$message"; echo "
"; } //end of loop } echo "
sent $counter emails"; ?>