• 16-12-2022, 01:08:14
    #1
    Merhabalar,
    Ben textarea ile alt alta toplu mailler sistemi yapmaya çalışıyorum fakat bir hata aldım çözemedim. Yardımcı olursanız sevinirim.


    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\Exception;
    
    if(isset($_POST['submit'])) {
    // Gelen veriyi satır satır array'a alalım.
    $mailler = explode("\n", str_replace("\r", "", $_POST['pesan']));
     
    
    foreach ($mailler as $mail) {
    Mailgonder($mail);
    }
    
    
    
    require 'PHPMailer/src/Exception.php';
    require 'PHPMailer/src/PHPMailer.php';
    require 'PHPMailer/src/SMTP.php';  
    
    
    
    
        $mail = new PHPMailer(true);
    
        try {
        //Server settings-
        $mail->SMTPDebug = 0;                      //Enable verbose debug output
        $mail->isSMTP();                                            //Send using SMTP
        $mail->Host       = 'mail.privateemail.com';                     //Set the SMTP server to send through
        $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
        $mail->Username   = "";                     //SMTP username
        $mail->Password   = "";                               //SMTP password
        $mail->SMTPSecure = 'tls';            //Enable implicit TLS encryption
        $mail->Port       = 587;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
    
        //pengirim
        $mail->setFrom('"deneme@deneme.com', 'test');
        $mail->addAddress($mailler);    //Add a recipient
    
        //Content
        $mail->isHTML(true);                                  //Set email format to HTML
        $mail->Subject = $_POST['judul'];
        $mail->Body    = "test";
        $mail->AltBody = '';
        //$mail->AddEmbeddedImage('gambar/logo.png', 'logo');
        //$mail->addAttachment('');
    
        @$mail->send();
        return 'Message has been sent';
    } catch (Exception $e) {
        return "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
    
    }
    
    
    }
    
    ?>
  • 16-12-2022, 01:19:47
    #2
    Mailgonder diye bir fonksiyon tanımlamamışsınız.
  • 16-12-2022, 01:22:39
    #3
    Nasıl ayarlayabilirim sildiğimde garip bir hata alıyorum phpmailler ile ilgili.


    Warning: trim() expects parameter 1 to be string, array given in C:xampphtdocsmaillerprojectPHPMailersrcPHPMailer.p hp on line 1080
  • 16-12-2022, 01:25:46
    #4
    Hocam teamViewer var mı ?
  • 16-12-2022, 01:26:10
    #5
    evet var hocam yardımcı olursanız sevinirm
  • 16-12-2022, 01:26:55
    #6
    Özelden iletir misiniz?
  • 16-12-2022, 03:26:46
    #7
    yunusemre34 adlı üyeden alıntı: mesajı görüntüle
    Özelden iletir misiniz?
    hocam size özelden mesaj yazdım bakabilir misiniz?