// generate new id $sqlr = "SELECT max(idmessage) as newid from message "; $resultr = mysql_query($sqlr); if (mysql_num_rows($resultr) < 1) { $kode = 1; } else { $rowr = mysql_fetch_array($resultr); $kode = $rowr['newid'] + 1; } $query = "INSERT INTO messages "; $query .= "VALUES('{$kode}','1111111111','{$idmember}','{$message}','inputdate','1')"; $result = mysql_query($query); // sending email to customer related about the action $emailsender = "*****@*****.**"; $emailreceiver = $email; $namapengirim = "Roripon.com"; $namapenerima = $namamember; $subject = "Confirmation about your roricoins\tin roripon.com"; echo $isiemail = "\n\t<table width=\"625\" border=\"0\" align=\"center\" style=\"border:1px solid green\">\n\t <tr>\n\t\t<td colspan='2'> </td>\n\t </tr>\n\t <tr>\n\t\t<td align=\"right\">\n\t\t\t<img width=\"187\" height=\"88\" src=\"http://www.roripon.com/config/images/newtoplogo.png\" align=\"right\" />\n\t\t</td>\n\t\t<td width=\"605\"><p align=\"center\">\n\t\t\t<strong>PT. RORI PON</strong><br />\n\t\t\tJalan Dharmahusada Indah Utara Blok U/VI no. 319 Surabaya<br />\n\t\t\tTlp. 031 83222289/99, 031 71998877.<br/> \n\t\t\tEmail cs@roripon.com</p>\n\t\t</td>\n\t </tr>\t \n\t <tr>\n\t\t<td colspan='2'><hr color='green'></td>\n\t </tr>\n\t <tr>\n\t\t<td colspan='2'><i>You got this message via Roripon.com</i></td>\n\t </tr>\n\t <tr>\n\t\t<td align='left' colspan='2'>From : {$namapengirim}" . "(" . $emailsender . ")</td>\n\t </tr> \n\t <tr>\n\t\t<td align='left' colspan='2'>Subject : {$subject}</td>\n\t </tr> \n\t <tr>\n\t\t<td colspan='2'> </td>\n\t </tr> \n\t <tr>\n\t\t<td colspan='2'>" . $greet1 . "\n\t\t</td>\n\t </tr>\n\t</table>"; $sender = new MailSender(); $sender->set_from($emailsender); $sender->set_from_name($namapengirim); $sender->set_message($isiemail); $sender->set_subject($subject); $sender->set_to($emailreceiver); $sender->set_to_name($namapenerima); $sender->send(); if ($sender) { $pesan = "An email has been sent to member's email address. Update " . $prod . " success."; } echo "<script>alert(\"{$pesan}\");window.location='javascript:javascript:history.go(-2)';</script>";