thanks again for replying, but it still doesn't work.
This is the code I have now:
$mail = new PHPMailer();
$mail->IsMail(); // telling the class to use SMTP
$mail->From = "email@example.com";
$mail->AddAddress("firstname.lastname@example.org", "Altin Toooola");
$mail->Subject = "testing phpmailer thing";
$mail->Body = "Hi! \
This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;
$path = $_FILES['userfile']['tmp_name'];
$name = $_FILES['userfile']['name'];
$encoding = "base64";
$type = "image/gif";
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
echo 'Message has been sent.';
<form action="test.php" method="post" enctype="multipart/form-data">
<input class="text" type="file" name="attachment" size="50" />
<input type="submit" name="submit" value="Submit" class="form-button" />
I tryed it with the 3 different possibilitys:
With the 2 first ones, I get the message that the mail is sent, but I can't see an attachment.
With the last one, I sort of get an attachment:
I see there's an attachment, but I don't see a preview, it's called "noname" and when i try to see it, it doesn't load neether.