Postingan lainnya
tambah dan kurang jam
saya menggunakan
public function kirim_email()
{
$email= $this->DonasiModel->all3();
//print_r($row);
//load method template
foreach ($email as $row) {
date_default_timezone_set('Asia/Jakarta');
$date= date('Y-m-d H:i:s');
$time=$row['schedule_date'];
if ($date>=$time) {
$idemail=$row['email_id'];
$subject=$row['subject'];
$message=$row['message'];
$emailpenerima = $row['to_email'];
$ci = get_instance();
//$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://mail.untukpalestina.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "admin@untukpalestina.com";
$config['smtp_pass'] = "test$2012$";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$ci->load->library('email',$config);
// $ci->email->initialize($config);
$ci->email->from($row['from_email'],$row['from_nama']);
$ci->email->to($emailpenerima);
$ci->email->subject($subject);
$ci->email->message($message);
if ($this->email->send()) {
echo 'Email sent.';
$this->DonasiModel->updateemail($idemail);
}
}
else {
echo "error";
}
}
}
saya pakai codingan itu untuk kirim email otomatis d cronjob tapi hostingnya hanya bisa mengecek 5 menit sekali ga bisa perdetik nah masalahnya jika <= schduledate(data yg d db) semuanya kekirim bersamaaan padahal seharusnya setiap 6 , 18 ,24 jam jedanya nah bagaimana yah cara mengatasi itu
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban