Cara kirim email di phpmailer untuk OTP


horasjey

Apprentice 1.0
1734770043587.png

Hallo om, izin bertanya kira kira pesan eror di bawah ini artinya apa ya om?



PHP:
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 dany1.******.com ESMTP Exim 4.97.1 Sat, 21 Dec 2024 03:12:36 -0500 "
SMTP -> get_lines(): $data is "220 dany1.******.com ESMTP Exim 4.97.1 Sat, 21 Dec 2024 03:12:36 -0500 "
SMTP -> FROM SERVER:220 dany1.******.com ESMTP Exim 4.97.1 Sat, 21 Dec 2024 03:12:36 -0500
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $str is "250-SIZE 536870912 "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 "
SMTP -> get_lines(): $str is "250-8BITMIME "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $str is "250-PIPECONNECT "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT "
SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $str is "250-STARTTLS "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250-STARTTLS "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250-STARTTLS "
SMTP -> get_lines(): $str is "250 HELP "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP "
SMTP -> FROM SERVER: 250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 TLS go ahead "
SMTP -> get_lines(): $data is "220 TLS go ahead "
SMTP -> FROM SERVER:220 TLS go ahead
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] "
SMTP -> get_lines(): $str is "250-SIZE 536870912 "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 "
SMTP -> get_lines(): $str is "250-8BITMIME "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME "
SMTP -> get_lines(): $str is "250-PIPELINING "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING "
SMTP -> get_lines(): $str is "250-PIPECONNECT "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT "
SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $data was "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN "
SMTP -> get_lines(): $str is "250 HELP "
SMTP -> get_lines(): $data is "250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250 HELP "
SMTP -> FROM SERVER: 250-dany1.******l.com Hello dany1.******.com [66.**.**.178] 250-SIZE 536870912 250-8BITMIME 250-PIPELINING 250-PIPECONNECT 250-AUTH PLAIN LOGIN 250 HELP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 "
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 "
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "235 Authentication succeeded "
SMTP -> get_lines(): $data is "235 Authentication succeeded "
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 OK "
SMTP -> get_lines(): $data is "250 OK "
SMTP -> FROM SERVER:250 OK
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 Accepted "
SMTP -> get_lines(): $data is "250 Accepted "
SMTP -> FROM SERVER:250 Accepted
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "354 Enter message, ending with "." on a line by itself "
SMTP -> get_lines(): $data is "354 Enter message, ending with "." on a line by itself "
SMTP -> FROM SERVER:354 Enter message, ending with "." on a line by itself


saya lagi ada test buat kirim otp ke email yang dafar ke situs ,

tp email nya tidak ada masuk ke tujuan :20::20:

saya pakai scrpit php mailer dari rumah web
1734770129553.png



colek tuan @reyokh , boleh donk bisik-bisik system otp email register di web nya :77:
 
Halo Ka @horasjey kalau diperhatikan kirim sudah sukses namun di email tujuan belum sampai?

dicoba crosscheck juga di akun pengirim apakah ada respon failed?

karena biasanya bisa mendapatkan petujuk dari pengiriman yang gagal atau rmail yang tertolak.

pastikan juga domain yang digunakan untuk email pengirim sudah dikonfigurasi dkim dan spf nya (biasanya gmail menolak dgn mail server yg konfigurasi kurang sesuai sebagai syarat standar google)
 
colek tuan @reyokh , boleh donk bisik-bisik system otp email register di web nya :77:

@horasjey ini paramter PHPmailer yang saya gunakan:

Code:
@require "phpmailer/autoload.php";
use PHPMailer\PHPMailer\PHPMailer;

$mailer_debug    = 0;
$mailer_name    = "";
$mailer_host    = "";
$mailer_port    = "";
$mailer_user    = "";
$mailer_pass    = "";
$title            = "";
$msg            = "";

    $mail = new PHPMailer;
    $mail->isSMTP();
    $mail->SMTPDebug = @$mailer_debug;
    $mail->Debugoutput = 'text';
    if (@strstr(@strtolower(@$mailer_host),".gmail.com")) {
        $mail->SMTPSecure = 'tls';
    } else {
        $mail->SMTPSecure = 'ssl';
    }
    $mail->SMTPAuth = true;
    $mail->Host = @$mailer_host;
    $mail->Port = @$mailer_port;
    $mail->Username = @$mailer_user;
    $mail->Password    = @$mailer_pass;
    $mail->setFrom(@$mailer_user,@$mailer_name);
    $mail->addAddress(@$to,@$to);
    $mail->Subject = @$title;
    $mail->addCustomHeader('Content-type','text/html; charset=UTF-8');
    $mail->msgHTML(@$msg);
    $mail->XMailer = '© '.@$mailer_name;
    $mail->AltBody = '';
    
    if (!$mail->send()) return false; else return true;
 
@horasjey ini paramter PHPmailer yang saya gunakan:
Hallo tuan,

@require "phpmailer/autoload.php"; use PHPMailer\PHPMailer\PHPMailer;
Ini gmna ya cara installnya tuan..?
file autoload ini apakah bs langsung di copy paste ke directory root atau harus compresor..?
 
Hallo tuan,


Ini gmna ya cara installnya tuan..?
file autoload ini apakah bs langsung di copy paste ke directory root atau harus compresor..?
Melalui composer dahulu Kak, yang Kakak share di awal bukakah sudah menjalankan PHPMailer? Atau itu hanya sample?
 
Melalui composer dahulu Kak, yang Kakak share di awal bukakah sudah menjalankan PHPMailer? Atau itu hanya sample?
Tidak ada jalankan compresor tuan,
Cukup download file di web rumahweb terus extrak di directory public nya tuan
 
Tidak ada jalankan compresor tuan,
Cukup download file di web rumahweb terus extrak di directory public nya tuan

kalau memang sudah dipaketin hasil composer PHPmailer nya tidak masalah, dicoba extact saja, jangan dirubah2 posisi file / foldernya.
nanti file kirimemail.php nya bisa ditempatkan di folder yang ada autoload.php
 
kalau memang sudah dipaketin hasil composer PHPmailer nya tidak masalah, dicoba extact saja, jangan dirubah2 posisi file / foldernya.
nanti file kirimemail.php nya bisa ditempatkan di folder yang ada autoload.php
sip tks tuan,
dah Clear
1734947977845.png
 
Back
Top