I know lot of qeustions about this have already been asked about phpmailer but i couldnt find a solution for myself. Here is my HTML form:
<div class="info">
<form class="solliciteren" action="" method="post">
Naam
<input type="text" name="naam" value="">Telefoonnummer
<input type="text" name="telefoonnummer" value="">Email
<input type="email" name="emailid" value="">Leeftijd
<input type="number" name="leeftijd" value="">Upload uw CV
<input type="file" name="uploaded_file" value="CV">
<input type="submit" name="verzenden" value="Verzenden">
</form>
When i use my php code it will send everything to my gmail account but the problem is if i send a file it will show that there is a file send but i cant open or download it in gmail because it is saved as an .tmp file. Here is my PHP code:
<?php
if(isset($_POST['verzenden']))
{
$message=
'naam: '.$_POST['naam'].'<br />
telefoonnummer: '.$_POST['telefoonnummer'].'<br />
email: '.$_POST['emailid'].'<br />
leeftijd: '.$_POST['leeftijd'].'<br />
upload: '.$_POST['uploaded_file'].'
';
require "phpmailer/class.phpmailer.php";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Encoding = '7bit';
$mail->Username = "mygmailaccount@gmail.com";
$mail->Password = "mygmailpassword";
$mail->SetFrom($_POST['emailid'], $_POST['naam']);
$mail->AddReplyTo($_POST['emailid'], $_POST['naam']);
$mail->Subject = "Nieuwe Sollicitatie!";
$mail->MsgHTML($message);
$mail->AddAddress("mygmailaccount@gmail.com", "my name");
$result = $mail->Send();
$message = $result ? 'Sollicitatie is ontvangen!' : 'Bericht is niet verstuurd! Probeer het opnieuw!';
unset($mail);
}
?>
My Qeustion I want people to upload a file(.word/.txt/.jpg or anything else) in my html form which i can open/download in the gmail account where the mail is been send to. The problem now is that it will show a file is send, but i can't open or download it because it is saved as a .TMP file.