PhpMailer attachment gambar gak bisa di lihat

buzz

Beginner 1.0
mohon pencerahannya master, phpmailer sukses mengirim ke email tapi file attachment tdk bisa dibuka kenapa yah ?

code :
$mail->AddAttachment($_FILES['attachment']['tmp_name'], $_FILES['attachment']['name']);

<div class="form-group">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"> Upload : <input name="attachment" type="file">
</div>

kekurangannya dmn master
 

Attachments

BUANA dotnet

Expert 1.0
Verified Provider
coba cek di php script nya, mungkin encoding nya belum sesuai
 

buzz

Beginner 1.0
Code:
<?php
$result = "";
if (isset($_POST['submit'])) {
    
    require 'PHPMailer/PHPMailerAutoload.php';

    $mail = new PHPMailer;                     

    $mail->isSMTP();                                     
    $mail->Host = 'mail.domain.com';  
    $mail->SMTPAuth = true;                               
    $mail->Username = '[email protected]';                
    $mail->Password = 'xxxx';                          
    $mail->SMTPSecure = 'ssl';                           
    $mail->Port = 465;                                   

    $mail->setFrom('[email protected]', '[email protected]');
    $mail->addAddress('[email protected]', 'Email Send');     
    
    $mail->AddAttachment($_FILES['attachment']['tmp_name'], $_FILES['attachment']['name']);

    $mail->isHTML(true);                                  

    $mail->Subject = 'New Email';
    $mail->Body = 'Send Email';
   
    if (!$mail->send()) {
        $result = 'Form Tidak Dapat Terkirim.';
        $result = 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        $result = 'Terimakasih ';
    }
}
?>
yang kurang dimana yah tuan :77:
 

buzz

Beginner 1.0
Kalau attachment nya pasti image
coba pakai
$mail->AddEmbeddedImage(filename, cid, name);
saya rubah code nya tapi file gak masuk ke email
Code:
$mail->AddEmbeddedImage($_FILES['attachment']['tmp_name'], $_FILES['attachment']['name']);
 

    
Top