SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | - | require_once("Mail.php");
|
| 2 | + | /* |
| 3 | - | require_once('Mail/mime.php');
|
| 3 | + | insert |
| 4 | - | |
| 4 | + | ================================= |
| 5 | - | $recipients = $ar['to']; |
| 5 | + | Task Helper berisi |
| 6 | - | $headers["From"] = $ar['from']; |
| 6 | + | * insert tugas ke table |
| 7 | - | $headers["Return-Path"] = $ar['from']; |
| 7 | + | |
| 8 | - | $headers["To"] = $ar['to']; |
| 8 | + | ================================= |
| 9 | - | $headers["Subject"] = $ar['title']; |
| 9 | + | */ |
| 10 | - | $crlf = "\n"; |
| 10 | + | function taskInsert($data,$type) |
| 11 | - | $mailmsg=$ar['contents']; |
| 11 | + | {
|
| 12 | - | $mime = new Mail_mime($crlf); |
| 12 | + | $arType=array('t_type'=>$type);
|
| 13 | - | $mime->setHTMLBody($mailmsg); |
| 13 | + | /* |
| 14 | - | $body = $mime->get(); |
| 14 | + | title, from, to, contents |
| 15 | - | $header = $mime->headers($headers); |
| 15 | + | $data=array( |
| 16 | - | |
| 16 | + | 'title'=>xxxx, |
| 17 | - | $smtpinfo["host"] = "mail.inibayiku.com"; |
| 17 | + | 'from'=>xxx etc, |
| 18 | - | $smtpinfo["port"] = "25"; |
| 18 | + | 'to'=>xxxx, |
| 19 | - | $smtpinfo["auth"] = true; |
| 19 | + | 'contents'=>xxx |
| 20 | - | $smtpinfo["username"] = "[email protected]"; |
| 20 | + | ); |
| 21 | - | $smtpinfo["password"] = "inibayiku"; |
| 21 | + | */ |
| 22 | - | |
| 22 | + | |
| 23 | - | $mail_object =& Mail::factory("smtp", $smtpinfo);
|
| 23 | + | $arType['t_detail']=json_encode($data); |
| 24 | - | $mail_object->send($recipients, $header, $body); |
| 24 | + | |
| 25 | foreach($arType as $n=>$v) $$n=addslashes($v); | |
| 26 | $sql="insert into task (t_type,t_detail) values ('$t_types','$t_detail')";
| |
| 27 | ||
| 28 | ||
| 29 | }//function taskInsert($data,$type) |