<?php
require("class.phpmailer.php");
require("class.smtp.php");
$linkrel_1 = "../collaborazione_sent.html";
$email_from = $_POST['email'];
$email_me = "##";
$name = $_POST['name'];
$telefono = $_POST['telefono'];
$citta= $_POST['citta'];
$indirizzo = $_POST['indirizzo'];
$cap = $_POST['cap'];
if ($email_from == '')
{
$name = $email_from;
}
$mail1 = new PHPMailer(true);
$mail1->Host = "##"; // SMTP server
$mail1->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail1->SMTPAuth = true; // enable SMTP authentication
$mail1->Host = "##"; // sets the SMTP server
$mail1->Port = 26; // set the SMTP port for the GMAIL server
$mail1->Username = "##"; // SMTP account username
$mail1->Password = "##"; // SMTP account password
$mail1->From = "##";
$mail1->FromName = "##";
$mail1->AddAddress("##");
$mail1->WordWrap = 50;
$mail1->AddAttachment("attach/allegato1.PDF");
$mail1->AddAttachment("attach/allegato2.PDF");
$mail1->AddAttachment("attach/allegato3.PDF");
$mail1->AddAttachment("attach/allegato4.PDF");
$mail1->AddAttachment("attach/allegato5.pdf");
$mail1->IsHTML(true); // send as HTML
$mail1->Subject = "Richiesta Collaborazione";
$mail1->Body = "##";
$mail1->AltBody = "";
$mail1->Send();
$mail = new PHPMailer(true);
$mail->Host = "##"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "##"; // sets the SMTP server
$mail->Port = 26; // set the SMTP port for the GMAIL server
$mail->Username = "##"; // SMTP account username
$mail->Password = "##"; // SMTP account password
$mail->From = "##";
$mail->FromName = "$name";
$mail->AddAddress("##");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "##";
$mail->Body = "Nome: $name
Email: $email_from
Telefono: $telefono
Indirizzo: $indirizzo
Città: $citta
CAP: $cap";
$mail->AltBody = "";
$mail->Send();
header ("Location: $linkrel_1");
?>
Mi da errore sull'header: e precisamente "Cannot modify header information - headers already sent by". Pero non credo che ci sia un output.
Come faccio per risolverlo?
Grazie