This topic is locked
[SOLVED]

 automatic e-mail?

3/6/2012 1:38:43 PM
PHPRunner General questions
B
bilboss author

hello I can send an automatic email every night, containing all the entries this day, and that user was that the entry or edit.

or send a report with totals.
thank you very much in advance

Sergey Kornilov admin 3/6/2012
B
bilboss author 3/7/2012

thank you very much ...

there is a way to mail the same page that contains a list

I understand?

Sergey Kornilov admin 3/7/2012

I'm not sure how you can send the list page. You can definitely send a link to the list page.

B
bilboss author 3/7/2012

thank you very much, with this and I can solve my problem

D
DouglasB 3/10/2012

BillBoss,
Follow Sergey's example it works! A couple of things to pay attention to such as the $MSG syntax.
Here's my code:
<?php
include("include/dbcommon.php");

global $dal;

$dalTableName = $dal->Table("GPS_tbl_proposal");

$rstmp = $dalTableName->Query("DateDiff(now(),dte_FollowUp)>=0","");;

while ($datatmp = db_fetch_array($rstmp))

{
//send email for each record

$email=$datatmp["str_eMail_Notify"];

//EmailField is your actual field name

$msg.="This event has expired. Please log on and update this proposal.\r\n";

$msg.="Proposal ID: ".$datatmp["int_Proposal_ID"]."\r\n";

$msg.="Followup Notes: ".$datatmp["str_FU_Notes"]."\r\n";

$subject="Expired Follow up Event in the Gainco Proposal System Needs Your Attention";

//print_r($datatmp);

//echo "
email: ";
if ($email)

mail($email, $subject, $msg);

// runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg));
// phpinfo();

}
//FieldName1, FieldName2 and ExpiryDate are your actual field names, TableName is your actual table name
?>
Once you defined what you want sent to you and the formatting save it as a php file in your output directory. Next create a CRON JOB on your server. If you haven't done this before ask your server host to do it for you. All you want the cron job to do is launch the php file. In this case DailySendMail.php at a certain time each day.
OH! ensure you are running php5 not php4. check your htaccess file to be 100% positive. That was my main problem.