Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Mencantumkan kode program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

hasil tabel yang looping, trus di send ke email

kok ga muncul2 ya ketika send email berbentuk dengan format html;
ada bagian dari tabel yang aku looping dan ga ada isinya ketika email telah diterima...;;
contoh
$tengah=$query whileend while
$message=$tengah
nah hasil $tengah itu kok ga munculnya

semoga dapat dimengerti..
thnk
:):)

Tanggapan

  • sebelum dikirim emailnya u echo dulu deh $tengah nya

    btw $header ngga ada isinya?



    note : panjang amat skripnya dul .. :P:D
  • maap mas admin postnya puajang bgt hehe

    <?
    $tengah="
    <table width='100%' border=0 cellpadding=0 class=featuresBar cellspacing=1>
    <tr bgcolor=#A9D5FC>
    <td width='5%' height=22> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>NO</strong></font></div></td>
    <td width='20%' height=22 bgcolor=#A9D5FC> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>DATE</strong></font></div></td>
    <td width='75%' height=22> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>STATUS</strong></font></div></td>
    </tr>";
    ?>
    <?
    $i=1;
    $select_status=mysql_query("select date_status,status from t_status_external where ponumber='$_POST[ponumber]' order by no_urut asc");
    while($status=mysql_fetch_array($select_status))
    {
    list($thn,$bln,$tgl) = split('[-]', $status[date_status]);
    switch($bln)
    {
    case 1:
    $bulan=January;
    break;

    case 2:
    $bulan=February;
    break;

    case 3:
    $bulan=March;
    break;

    case 4:
    $bulan=April;
    break;

    case 5:
    $bulan=May;
    break;

    case 6:
    $bulan=Jun;
    break;

    case 7:
    $bulan=July;
    break;


    case 8:
    $bulan=August;
    break;

    case 9:
    $bulan=September;
    break;

    case 10:
    $bulan=October;
    break;

    case 11:
    $bulan=November;
    break;

    case 12:
    $bulan=December;
    break;

    }
    echo"
    <tr bgcolor=#C1E0FD onmouseover=this.style.backgroundColor=#E2F1FE onmouseout=this.style.backgroundColor=#C1E0FD>
    <td height=22 bgcolor=><div align=center> <font size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $i
    </font></div></td>
    <td height=22 bgcolor=> <div align=left> <font size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $bulan
    $tgl
    ,
    $thn
    </font></div></td>
    <td height=22 bgcolor=> <font size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $status[status]
    </font></td>
    </tr>";

    $i++;
    }
    echo"
    </table>";
    ?>
    <?
    $message="
    <html>
    <head>
    <title>YOUR PO INFORMATION UPDATE</title>
    <meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>
    </head>

    <body>
    <table width='100%' border=0 cellspacing=0 cellpadding= >
    <tr align=left valign=top>
    <td height='20'>&nbsp;</td>
    <td height='20' colspan=2 valign=bottom>&nbsp;</td>
    <td height='20'>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height='20'>&nbsp;</td>
    <td height='20' valign=bottom bgcolor=E2F1FE>&nbsp;</td>
    <td height='20' valign=bottom bgcolor=E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>YOUR PO INFORMATION UPDATE</font></td>
    <td height='20'>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td width='7%' height=20>&nbsp;</td>
    <td height='20' valign=bottom bgcolor=E2F1FE>&nbsp;</td>
    <td height='20' valign=bottom bgcolor=E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>COMMON INFORMATION</font></td>
    <td width='8%' height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 colspan=2><table width='100%' border=0 class=featuresBar cellspacing=1 cellpadding=0 bordercolordark=#FFFFFF bordercolorlight=#FFFFFF bordercolor=#FFFFFF>
    <tr align=left valign=middle bgcolor=#A9D5FC>
    <td width='30%' height=22 bgcolor=#A9D5FC> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>CUSTOMER</strong></font></div></td>
    <td width='13%' height=22 bgcolor=#A9D5FC> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>PO
    NUMBER</strong></font></div></td>
    <td width='29%' height=22> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>PORT
    OF LOADING</strong></font></div></td>
    <td width='28%' height=22> <div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><strong>PORT
    OF DISCHARGE</strong></font></div></td>
    </tr>
    <tr bgcolor=#C1E0FD onmouseover=this.style.backgroundColor=#E2F1FE onmouseout=this.style.backgroundColor=#C1E0FD>
    <td height=22 bgcolor=> <div align=center><font color=#000000 size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $data_po[cust_name]
    </font></div></td>
    <td height=22> <div align=center><font color=#000000 size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $data_po[ponumber_cust]
    </font></div></td>
    <td height=22> <div align=center><font color=#000000 size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $data_po[pol]
    </font></div></td>
    <td height=22> <div align=center><font color=#000000 size=2 face=Verdana, Arial, Helvetica, sans-serif>
    $data_po[pod]
    </font></div></td>
    </tr>
    </table></td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 colspan=2 bgcolor=E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>&nbsp;</font></td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 valign=bottom bgcolor=E2F1FE>&nbsp;</td>
    <td height=20 valign=bottom bgcolor=E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>STATUS
    DETAIL</font></td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 colspan=2>
    $tengah
    </td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 colspan=2 bgcolor=E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>&nbsp;</font></td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td width='2%' height=20 bgcolor=#E2F1FE>&nbsp;</td>
    <td width='83%' bgcolor=#E2F1FE><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Thank
    You For Your Attention<br>
    Best Rgds, <br>
    MATS Express <br>
    Customer Services <br>
    Phone : 021 39837188<br>
    Fax : 021 39837199<br>
    Web site <a href=www.mats24.com>http://www.mats24.com/</a><br>;
    </font></td>
    <td height=20>&nbsp;</td>
    </tr>
    <tr align=left valign=top>
    <td height=20>&nbsp;</td>
    <td height=20 bgcolor=#E2F1FE>&nbsp;</td>
    <td bgcolor=#E2F1FE>&nbsp;</td>
    <td height=20>&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>";
    ?>
    <?
    $kirim=mail($to, $subject, $message,$headers);
    if($kirim)
    {
    ?>
    <SCRIPT language="javascript">
    javascript:window.close();
    </SCRIPT>
    <?
    }
    else
    {
    echo"<div align=center>";
    echo"<font face=verdana size=1 color=red>";
    echo "Email gagal terkirim";
    }
    ?>
  • bisa di perjelas?potongan skripnya kaya apa?
  • klo soal di echo dulu udah di coba dan hasilnya yahud tuh alias muncul querynya.. :D:D
  • aku persempit lagi deh..
    bisa kira2 kita mengirimkan hasil query yang telah di looping ke email....????

    klo ada yang pernah py yang kyk gt share yaa

    :D:D:D thnk bgt
  • Bisa kok

    Nih potongan skripnya.
    Skrip ini berisi daftar inquiry yang dipesan user lalu hasilnya dikirim lewat email
    <?
    //....
    $subject="Ada inquiry baru";
    $pesan="Ada inquiry baru";
    $pesan.="\r\n";
    $pesan="Data pemesan :";
    $pesan.="\r\n";
    $pesan.="Nama : $nama\r\n";
    $pesan.="Alamat :\r\n$alamat\r\n";
    $pesan.="Kota : $kota\r\n";
    $pesan.="Negara : $negara\r\n";
    $pesan.="Telepon Rumah : $telp\r\n";
    $pesan.="Kodepos : $kode_pos\r\n";
    $pesan.="Gender : $gender\r\n";
    $pesan.="\r\n";
    $pesan.="Rincian inquiry\r\n\r\n";
    $sql="select a.IDBarang as IDBarang,Jumlah,KodeBarang,Nama from tcart a, mbarang b
    where a.IDBarang=b.IDbarang and IDCart='".$_SESSION["cart_id"]."'";
    $qry=mysql_query($sql) or die (mysql_error());
    while($row=mysql_fetch_array($qry)){
    $pesan.="- (Kode : ".$row["KodeBarang"].") ".$row["Nama"]." jumlah : ".$row["Jumlah"]."\r\n";
    }
    $pesan.="\r\nDemikian inquiry baru ini. Mohon segera diproses";
    $email_admin="sales@site.com";
    $header="From: $nama<$email>";
    mail($email_admin,$subject,$pesan,$header);
    echo "Thank you .... bla bla ...";
    ?>
  • terima kasih om goku
    segera dipelajari dulu...
    makasih sekali ;);););)
  • udah aku OOT dan hasilnya sip banget berjalan sesuai yang diinginkan...
    matur thank u mas goku :):)

    NB : trus klo pake tabel menampilkannya supaya lebih terlihat rapi dan berwarna, pake metode apa yach... ;)
  • Jadikan html email

    Coba ubah
    &lt;?
    //....
    $pesan=&quot;Ada inquiry baru&quot;;
    $pesan=&quot;&lt;br&gt;Data pemesan :&quot;;
    $pesan.=&quot;&lt;br&gt;&quot;;
    $pesan.=&quot;&lt;table&gt;&quot;;
    $pesan.=&quot;&lt;tr&gt;&lt;td&gt;Nama&lt;/td&gt;&lt;td&gt;:&lt;/td&gt;&lt;td&gt;$nama&lt;/td&gt;&lt;/tr&gt;&quot;;
    // dsb sampai terakhir
    $pesan.=&quot;&lt;/table&gt;&quot;;
    $pesan.=&quot;&lt;br&gt;&quot;;
    $pesan.=&quot;Rincian inquiry&quot;;
    $pesan.=&quot;&lt;table&gt;&quot;;
    $pesan.=&quot;&lt;tr&gt;&lt;td&gt;Kode barang&lt;/td&gt;&lt;td&gt;Nama&lt;/td&gt;&lt;td&gt;Jumlah&lt;/td&gt;&lt;/tr&gt;&quot;;
    $sql=&quot;select a.IDBarang as IDBarang,Jumlah,KodeBarang,Nama from tcart a, mbarang b
    where a.IDBarang=b.IDbarang and IDCart=&#039;&quot;.$_SESSION[&quot;cart_id&quot;].&quot;&#039;&quot;;
    $qry=mysql_query($sql) or die (mysql_error());
    while($row=mysql_fetch_array($qry)){
    $pesan.=&quot;&lt;tr&gt;&lt;td&gt;&quot;.$row[&quot;KodeBarang&quot;].&quot;&lt;/td&gt;&lt;/td&gt;&quot;.$row[&quot;Nama&quot;].&quot;&lt;/td&gt;&lt;td&gt;&quot;.$row[&quot;Jumlah&quot;].&quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
    }
    $pesan.=&quot;&lt;/table&gt;&quot;;
    $pesan.=&quot;Demikian inquiry baru ini. Mohon segera diproses&quot;;
    $subject = &quot;Ada inquiry baru&quot;;
    $headers = &quot;MIME-Version: 1.0\r\n&quot;;
    $headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;
    $headers .= &quot;From: $nama&lt;$email&gt;\r\n&quot;;
    $email_admin=&quot;sales@site.com&quot;;
    mail($email_admin, $subject, $pesan, $headers);
    echo &quot;Thank you .... bla bla ...&quot;;
    ?&gt;
    
  • sekali lagi top om goku ;););)
Sign In or Register to comment.