Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

ask mohon dibantu runemail.sh tidak jalan di linux

master

aq buat file php dengan nama ultah.php
aq simpan di folder htdocs/prathama/master/ultah.php

aq jalankan dari windows jalan langsung email aq terima

aq coba buat file runemail.sh tidak mau jalan ketika aq coba ( belum di crontab)

isinya : nohup elinks http://localhost/prathama/master/ultah.php &

ada yang salah gak master ??? tolong diberi pencerahannya master


#:-S
Tagged:

Comments

  • runemail.sh ini ada dimana ?
    di os windows ?
    atau os *nix ?
  • edited November 2014
    di linux master....scrip ultah.php aq jalankan di windows bisa emailnya...
    aq jalankan dr localhost browser di linux bisa tapi saat buat file runemail.sh utk crontab tidak mau jalan
    salah dimana y master?

    isi runemail.sh di linux

    nohup elinks http://localhost/prathama/master/ultah.php &

    apa tidak perlu buat file .sh ya master ? apa langsung ke crontab -e ??

    mohon pencerahannya master....
    kalau dijalankan di browse baik di windows / linux jalan



  • edited January 2015
    ini script ultah. php

    $today = date('m-d');

    mysql_select_db($database_prathama, $prathama);
    $query_ultah = "SELECT company,email,tgl_con FROM consigne WHERE tgl_con LIKE '%$today'";
    $ultah = mysql_query($query_ultah, $prathama) or die(mysql_error());
    $row_ultah = mysql_fetch_assoc($ultah);
    $totalRows_ultah = mysql_num_rows($ultah);


    <p><?php

    require '../phpmailer/class.phpmailer.php';

    $date = date('d-m-Y');

    if ($totalRows_ultah>0){
       
        $mail      = new PHPMailer(true);
        $body      =  "<html>

    <head>

    </head>

    <body>
       
        <br> HAPPY BIRTH DAY ".$row_ultah['company']." </br>
        <br> SEMOGA PANJANG UMUR DAN SUKSES </br>
       
       
        </body>
        </html>";
       
        $mail->IsSMTP();                           // tell the class to use SMTP

    $mail->SMTPAuth   = true;                  // enable SMTP authentication

    $mail->SMTPSecure = 'tls';

    $mail->Port  = 587;                    // set the SMTP server port

    $mail->Host  = 'smtp.gmail.com'; // SMTP server

    $mail->Username   = 'endra.gst@xxx.com';     // SMTP server username

    $mail->Password   = 'xxxxxxxx';            // SMTP server password

    //$mail->IsSendmail();  // tell the class to use Sendmail

    $mail->AddReplyTo('endra.gst@xxx.com');

    $mail->From   = 'endra.gst@xxx.com';

    $mail->FromName   ='Personalia';

    $to = $row_ultah['email'];

    $mail->AddAddress($to);

    $mail->Subject  = 'Selamat Ulang Tahun ';

    //$mail->AltBody    = “To view the message, please use an HTML compatible email viewer!”;

    // optional, comment out and test

    //$mail->WordWrap   = 80; // set word wrap

    $mail->MsgHTML($body);

    $mail->IsHTML(true); // send as HTML

    $mail->Send();

    echo 'Message has been sent.';

    }


    ?>
  • edited January 2015
    solved master
    aq tidak pakai file . SH, langsung di crontab

    * * * * * wget -O - http://localhost/prathama/master/ultah.php 2>&1

    jika aq coba menampilkan tabel ( email berupa tabel ) ada yang aneh munculnya
    ARRAY gak jalan sepertinya
    Data yang muncul hanya 1 baris saja.....salahnya dimana ya master ??


    image
    <p><?php

    require '../phpmailer/class.phpmailer.php';

    $date = date('d-m-Y');

    if ($totalRows_ultah>0){
       
        $mail      = new PHPMailer(true);
        $body      =  "<html>

    <head>

    </head>

    <body>
       
     <table width='370' border='1'>
      <tr>
        <td width='167'>company</td>
        <td width='90'>email</td>
        <td width='91'>tgl_con</td>
      </tr>
      while($row_ultah= mysql_fetch_assoc($ultah)) {
       <tr>
          <td>".$row_ultah['company']."</td>
          <td>".$row_ultah['email']."</td>
          <td>".$row_ultah['tgl_con']."</td>
        </tr>
      }
    </table>

       
       
        </body>
        </html>";

       
        $mail->IsSMTP();                           // tell the class to use SMTP

    $mail->SMTPAuth   = true;                  // enable SMTP authentication

    $mail->SMTPSecure = 'tls';

    $mail->Port  = 587;                    // set the SMTP server port

    $mail->Host  = 'smtp.gmail.com'; // SMTP server

    $mail->Username   = 'endra.gst@xxx.com';     // SMTP server username

    $mail->Password   = 'xxxxxxxx';            // SMTP server password

    //$mail->IsSendmail();  // tell the class to use Sendmail

    $mail->AddReplyTo('endra.gst@xxx.com');

    $mail->From   = 'endra.gst@xxx.com';

    $mail->FromName   ='Personalia';

    $to = $row_ultah['email'];

    $mail->AddAddress($to);

    $mail->Subject  = 'DATA HARI INI';

    //$mail->AltBody    = “To view the message, please use an HTML compatible email viewer!”;

    // optional, comment out and test

    //$mail->WordWrap   = 80; // set word wrap

    $mail->MsgHTML($body);

    $mail->IsHTML(true); // send as HTML

    $mail->Send();



    Salahnya dimana ya master ???



  • Ternyata HTML

    ***********SOLVED MASTER**************


    Terimakasih, Mohon Bimbingannya

    Case Close

    ^:)^ ^:)^ ^:)^
  • mohon dibantu master
    tiba" di server linux aq jalankan perintal php mailer tidak jalan muncul comment spt ini :

    Fatal error: Uncaught exception 'phpmailerException' with message 'SMTP Error: Could not connect to SMTP host.' in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php:705 Stack trace: #0 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(613): PHPMailer->SmtpConnect() #1 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(516): PHPMailer->SmtpSend('Date: Mon, 19 J...', '--b1_c85bd7f24f...') #2 /opt/lampp/htdocs/prathama/email/cbe.php(198): PHPMailer->Send() #3 {main} thrown in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php on line 705
  • edited January 2015
    itu kagak bisa konek ke smtp host nya

    smtp server pake apa ? pake gmail ?

    coba buka gmail langsung dari browser
    bisa atau kagak ?

    coba ping smtp.gmail.com, respon atau kagak ?
  • aq edit  extension=php_openssl.dll di PHP.INI

    tetap aja

    Fatal error: Uncaught exception 'phpmailerException' with message 'Language string failed to load: tls' in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php:689 Stack trace: #0 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(613): PHPMailer->SmtpConnect() #1 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(516): PHPMailer->SmtpSend('Date: Mon, 19 J...', '--b1_4e89a568ab...') #2 /opt/lampp/htdocs/prathama/email/cbe.php(198): PHPMailer->Send() #3 {main} thrown in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php on line 689


  • pakai GMAIL
    browser bisa
    ping ke smtp.gmail.com bisa
  • tuh password gmailnya mending diganti dulu dah ...
    elo posting koding pake gmail, password nya ikut elo post
  • ini di linux aja....
    aq coba di laptop ( windows xampp) jalan biasa mau ke send master.
  • edited January 2015
    password gmail nya sudah elo ganti ?
    soalnya gw masih bisa login ke akun gmail elo

    yg urusan linux, apache nya sudah di restart ?
    elo edit php ini nya sudah di file yg bener ? sudah dicek pake phpinfo() ?

    btw, elo coba buka dan ping gmail itu dari linux nya ?
    atau dari windows nya ?
  • <?php require_once('../Connections/prathama.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }

      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

    $thn= date('Y');
    $bln= date('m');
    $tanggal= date('Y/m/d');
    $tot=0;

    mysql_select_db($database_prathama, $prathama);
    $query_cb = "SELECT IFNULL(gl.acct_cd,'TOTAL')as acct_cd, IFNULL(gl.cabang,'Balance')as cabang, gl_chart.descs as ket, gl_chart.bcpc,  gl.cr_cd, (sum(gl.fdebet) - sum(fcredit))as saldo, gl.aperiod, gl.fyear FROM gl, gl_chart WHERE gl_chart.gl_code=gl.acct_cd AND gl.acct_cd=gl_chart.gl_code and gl_chart.bcpc='Y' and gl_chart.kurs='USD' and gl.cr_cd='USD' and gl.aperiod <='$bln' and gl.fyear='$thn' GROUP BY gl.cabang, gl.acct_cd WITH ROLLUP";
    $cb = mysql_query($query_cb, $prathama) or die(mysql_error());
    $totalRows_cb = mysql_num_rows($cb);

    $tot=0;
    mysql_select_db($database_prathama, $prathama);
    $query_cb1 = "SELECT IFNULL(gl.acct_cd,'TOTAL')as acct_cd, IFNULL(gl.cabang,'Balance')as cabang, gl_chart.descs as ket, gl_chart.bcpc,  gl.cr_cd, (sum(gl.debet) - sum(credit))as saldo, gl.aperiod, gl.fyear FROM gl, gl_chart WHERE gl_chart.gl_code=gl.acct_cd AND gl.acct_cd=gl_chart.gl_code and gl_chart.bcpc='Y' and gl_chart.kurs='IDR' and gl.cr_cd='IDR' and gl.aperiod <='$bln' and gl.fyear='$thn' GROUP BY gl.cabang, gl.acct_cd WITH ROLLUP";
    $cb1 = mysql_query($query_cb1, $prathama) or die(mysql_error());
    $totalRows_cb1 = mysql_num_rows($cb1);

    ?>

  • edited January 2015
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="shortcut icon" href="../image/favicon.ico" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PT.PRATHAMA LINE LOGISTICS</title>
    </head>

    <body>
    <?php



    if ($totalRows_cb>0) {

    $body .="<br>PT. PRATHAMA LINE LOGISTICS</br>";
    $body .="<br>UPDATE CASH BANK (USD) PERIOD ".$tanggal."</br>";

    $body .="<table border='1'>";
      $body .="<tr>";
        $body .="<th>Acct_cd</th>";
        $body .="<th>Branch</th>";
        $body .="<th>Descriptions</th>";
        $body .="<th>Forex</th>";
        $body .="<th>Saldo</th>";
      $body .="</tr>";
        $i=1;
        while ($row_cb = mysql_fetch_assoc($cb)){            
            if ($row_cb['cabang']=='SUB') {
                $w='#CC99FF'; }
        elseif ($row_cb['cabang']=='JKT') {
                $w='#FFFF66'; }
        elseif ($row_cb['cabang']=='BDO') {
                $w='#99FF66'; }
                else { $w='#FFFFFF'; }    
    $body .="<tr bgcolor='$w'>";
          $body .="<td>".$row_cb['acct_cd']."</td>";
          $body .="<td>".$row_cb['cabang']."</td>";
          $body .="<td>".($row_cb['acct_cd']=='TOTAL'?'':$row_cb['ket'])."</td>";
          $body .="<td>".($row_cb['acct_cd']=='TOTAL'?'':$row_cb['cr_cd'])."</td>";
          $body .="<td><div align='right'>".number_format($row_cb['saldo'],2,".","," )."</div></td>";
        $body .="</tr>";
        }
        
    $body .="</table>";

    $body .="<br></br>";
    $body .="<br>UPDATE CASH BANK (IDR) PERIOD ".$tanggal."</br>";
    $body .="<table border='1'>";
      $body .="<tr>";
        $body .="<th>Acct_cd</th>";
        $body .="<th>Branch</th>";
        $body .="<th>Descriptions</th>";
        $body .="<th>Forex</th>";
        $body .="<th>Saldo</th>";
     $body .=" </tr>";

        $i=1;
        while ($row_cb1 = mysql_fetch_assoc($cb1)){            
            if ($row_cb1['cabang']=='SUB') {
                $w='#CC99FF'; }
        elseif ($row_cb1['cabang']=='JKT') {
                $w='#FFFF66'; }
        elseif ($row_cb1['cabang']=='BDO') {
                $w='#99FF66'; }
                else { $w='#FFFFFF'; }    
    $body .="<tr bgcolor='$w'>";
          $body .="<td>".$row_cb1['acct_cd']."</td>";
          $body .="<td>".$row_cb1['cabang']."</td>";
          $body .="<td>".($row_cb1['acct_cd']=='TOTAL'?'':$row_cb1['ket'])."</td>";
          $body .="<td>".($row_cb1['acct_cd']=='TOTAL'?'':$row_cb1['cr_cd'])."</td>";
          $body .="<td><div align='right'>".number_format($row_cb1['saldo'],2,".","," )."</div></td>";
        $body .="</tr>";
        }

    $body .="</table>";

    }

    $body .="<br></br>";    

    require '../phpmailer/class.phpmailer.php';
        
        $mail      = new PHPMailer(true);
        
        $mail->IsSMTP();                           // tell the class to use SMTP

    $mail->SMTPAuth   = true;                  // enable SMTP authentication

    $mail->SMTPSecure = 'tls';

    $mail->Port  = 587;                    // set the SMTP server port

    $mail->Host  = 'smtp.gmail.com'; // SMTP server

    $mail->Username   = 'gusdehanzo@xxx.com';     // SMTP server username

    $mail->Password   = 'xxxxxxxx';            // SMTP server password

    //$mail->IsSendmail();  // tell the class to use Sendmail

    $mail->AddReplyTo('gusdehanzo@xxx.com');

    $mail->From   = 'gusdehanzo@xxx.com';

    $mail->FromName   ='SERVER PHP';

    $to = 'endra@xxx.com';


    $mail->AddAddress($to);


    $mail->Subject  = 'Auto Update Cash / Bank ';

    //$mail->AltBody    = “To view the message, please use an HTML compatible email viewer!”;

    // optional, comment out and test

    //$mail->WordWrap   = 80; // set word wrap

    $mail->MsgHTML( $body);

    $mail->IsHTML(true); // send as HTML

    $mail->Send();

    echo 'Message has been sent.';


    ?>
    <p>&nbsp;</p>
    </body>
    </html>
    <?php
    mysql_free_result($cb);
    mysql_free_result($cb1);
    ?>
  • edited January 2015
    hadoh ... tuh password di masking napa ?

    elo paham atau kagak sih maksud gw "password gmail elo diganti dulu" ?

    sekarang malah jadi 2 akun gmail elo mesti diganti password nya
  • edited January 2015
    //password gmail nya sudah elo ganti ?  sy coba pakai alamat gmail baru (gusdehanzo@xxx.com)
    soalnya gw masih bisa login ke akun gmail elo

    yg urusan linux, apache nya sudah di restart ? sudah master (sudo /opt/lampp/lampp restart)
    elo edit php ini nya sudah di file yg bener ? sudah dicek pake phpinfo() ? sudah master (Loaded Configuration File     /opt/lampp/etc/php.ini )

    btw, elo coba buka dan ping gmail itu dari linux nya ?
    atau dari windows nya ? PING nya dari DOS windows PC client
  • //elo paham atau kagak sih maksud gw "password gmail elo diganti dulu" ?

    mslh ganti password 2 account bisa ntar master...nie aq mumet dari kemarin malam sampe selesai M city vs arsenal gak jg solved, smp sekarang malah
    :-((
  • edited January 2015
    bukan ganti akun gmail nya ... * grrrr *

    elo itu posting alamat email lengkap dgn password nya
    gw bisa login ke akun gmail elo
    kalo gw sih kagak minat acak-acak akun orang lain ...
    lha kalo orang lain ?

    daripada ribet ...
    coba sekarang elo login ke 2 akun gmail elo
    endra.gst@xxx.com
    gusdehanzo@xxx.com
    bisa atau kagak ?

    pasti kagak bisa, karena password nya sudah gw ganti semua
  • kalo bermasalah koneksi ke gmail nya di linux nya ...
    testing koneksi dan ping smtp.gmail.com ya dari linux nya to maaassssss ...

    kalo elo testing dari windows elo ya kagak ada gunanya
    lha wong yg bermasalah linux nya

    itu dari awal linux nya gak bisa konek ke smtp.gmail.com
  • //pasti kagak bisa, karena password nya sudah gw ganti semua


    :-O
    wadeuhh
  • edited January 2015
    lha elo dikasih tau dari awal ...

    password baru sudah gw post ke inbox elo
    liat di menu atas, pasti ada pesan masuk


    urusan kaya begini jangan meleng mas
    iya kalo akun gmail elo cuma buat main-main
    lha kalo terhubung dgn rekening keuangan atau yg penting lainnya ?

    atau gw iseng kirim email maki-maki ke bos elo ? >:)
    atau yg ini "Anny Love" gw kirimin gambar porno gimana ? :D
    yg kena siapa ?
  • atau gw iseng kirim email maki-maki ke bos elo ?
    atau yg ini "Anny Love" gw kirimin gambar porno gimana ?
    yg kena siapa ?

    ***Ampun master**** otak HANK.. :((
    I believe in you master tdk mungkin lakuin itu ...

    PING linux smtp.gmail.com tdk mslh
    image

  • master aq coba buka gmail dari linux trus send email ke beberapa email dia ke send dan di terima oleh yang dituju berarti linux nya gak masalah, internet gak masalah
    aduuhh....puyeng nie
  • enable kan smtp debug nya, biar bisa tau fail koneksinya dimana

    $mail->SMTPDebug=1;
  • edited January 2015
    $mail->SMTPDebug=1;

    SMTP -> ERROR: RSET failed: MIA��I��?옪�?�����=��CK_��D�}g�@��'J\�pP�y���dB��Mo:�=�d�Y첃��x�a«)�Е��N�B爿W}b�� �{R���mO�v��'2sQH\i�Y��R�g+�\������5��GX������=@�Qr� 7�N��C��t����3���)����ȽLؾ€4�� iM�/@,d���2[b�V�����S�K����y?�M��`w$=��x��ږͧ>�D��?Q�0�A:z���^�t���z�Z�Є����Y
    Fatal error: Uncaught exception 'phpmailerException' with message 'Language string failed to load: tls' in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php:689 Stack trace: #0 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(613): PHPMailer->SmtpConnect() #1 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(516): PHPMailer->SmtpSend('Date: Mon, 19 J...', '--b1_03557f7040...') #2 /opt/lampp/htdocs/prathama/email/cbe.php(195): PHPMailer->Send() #3 {main} thrown in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php on line 689

    $mail->SMTPDebug=2;

    SMTP -> FROM SERVER:220 mx.google.com ESMTP os10sm10190620pbb.33 - gsmtp
    SMTP -> FROM SERVER: 250-mx.google.com at your service, [202.152.32.66] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
    SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS
    SMTP -> FROM SERVER:MIA��A���ya��T��Z�4-Z|5��N�.q��@4��9�S�x4���p�6 ��U�5��~��l�`[Z�����b`�t�XAK�֕�3��.��� ������y8�Kh52��c'*��k3�0_�T��F�גT�����V'�(Kynoϣ�sY{ ��@��[yͬ��`�0�o��w�ͷF֐k�M~�?�+_�V��nBKV�j����W��z�o�%Onj���\̩W�UZ�B.@�z�q��#�ţ>;I�;>Ԣ�������u�:�J|� U@-Y%[�~���R�fՀػj�2U��sm�L>�a�ׂұo�J
    SMTP -> ERROR: RSET failed: MIA��A���ya��T��Z�4-Z|5��N�.q��@4��9�S�x4���p�6 ��U�5��~��l�`[Z�����b`�t�XAK�֕�3��.��� ������y8�Kh52��c'*��k3�0_�T��F�גT�����V'�(Kynoϣ�sY{ ��@��[yͬ��`�0�o��w�ͷF֐k�M~�?�+_�V��nBKV�j����W��z�o�%Onj���\̩W�UZ�B.@�z�q��#�ţ>;I�;>Ԣ�������u�:�J|� U@-Y%[�~���R�fՀػj�2U��sm�L>�a�ׂұo�J

    Fatal error: Uncaught exception 'phpmailerException' with message 'Language string failed to load: tls' in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php:689 Stack trace: #0 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(613): PHPMailer->SmtpConnect() #1 /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php(516): PHPMailer->SmtpSend('Date: Mon, 19 J...', '--b1_6c6e96de83...') #2 /opt/lampp/htdocs/prathama/email/cbe.php(195): PHPMailer->Send() #3 {main} thrown in /opt/lampp/htdocs/prathama/phpmailer/class.phpmailer.php on line 689

  • sudah coba kirim email ?
  • hasilnya sprtii diatas master
  • di linux nya ada firewall ?
  • tidak ada master, aq install linux spt biasa trus install xampp
    tadi aq browsing ke gmail send email bisa ke send dan keterima

  • SOLVED MASTER

    jujur aq tdk mengerti aq sebelumnya memakai

    xampp-linux-x64-5.6.3-0-installer.run

    aq install ulang sampai 3 x ttp coment error spt itu

    tapi ketika ku install memakai versi sebelumnya mau lancar tanpa otak atik PHP.INI dsb...

    xampp-linux-x64-1.8.3-4-installer.run


    8->
Sign In or Register to comment.