I am making a php script which fetches the data of the records whose sending date and time has been reached, and then sends email to those records.
I want to do the following steps.
Step 1: get the communication records whose time has reached.
Step 2: run the loop of above and get the email addresses.
Step 3: run the loop of email addresses and send emails.
This is my php code…
<?php include('iSDK/src/isdk.php'); $myApp = new iSDK(); // Test Connnection if ($myApp->cfgCon("connectionName")) { echo "Connected..."; } else { echo "Not Connected..."; } $query = mysql_query('SELECT * FROM `emails` where senddate = NOW()'); $email=array(); $row = mysql_fetch_array($query); $count=mysql_num_rows($query); for($i=0; $i<$count; $i++){ $emailadd = $email['email']; for($i=0; $i<$count; $i++){ $conDat = array('Email' => $emailadd); $conID = $myApp->addCon($conDat); $clist = array($conID); $email = $myApp->sendEmail($clist,'[email protected]','~Contact.Email~','ccAddresses', 'bccAddresses', 'contentType', 'JK', 'htmlBody', 'txtBody'); } } if(isset($email)) { echo "Email Sent Successfully"; } else{echo"Email Sent Failed";} ?>any one tell me whats should be changed in this code?