I am using PHPMailer to send an email with attachment by a form, my code has no errors, but when I finish the form and press send, it returns an error but that the email was sent. Code:
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message= $_REQUEST['message'];
$message= "--$boundary" . PHP_EOL;
$message= "Content-Type: text/html; charset='utf-8'" . PHP_EOL;
$message= "--$boundary" . PHP_EOL;
$tapete=$_REQUEST['tapete'];
$medidas=$_REQUEST['medidas'];
$cliente=$_REQUEST['cliente'];
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "123Password";
$mail->setFrom = ('[email protected]');
$mail->Subject = 'Formulário FacilityCom';
$mail->Body = 'Tipo e marca: $tapete \nMedidas: $medidas \nCliente: $cliente\n $from';
$mail->AddAddress= ('[email protected]');
$mail->IsHTML(true);
$file_to_attach = $_FILES['file'];
$filename=$_FILES['file'];
$mail->AddAttachment($file_to_attach, $filename);
$mail->Send();
The error I get is:
Parse error: syntax error, unexpected '$ name' (T_VARIABLE) in /home/u746419992/public_html/index.php on line 42