Se non vediamo ne il codice ne la pagina non possiamo sapere dove intervenire!
Questo è il codice:
<form action="#" method="POST" name='form' onSubmit="return validaform();">
<input placeholder="Nome" Maxlength="15" class="nome" type="text" name="nome">
<input placeholder="Cognome" Maxlength="15" class="cognome" type="text" name="cognome">
<input placeholder="Email" Maxlength="25" type="text" class="email" name="email">
<textarea placeholder="Testo messaggio.." Maxlength="550" name="messaggio"></textarea>
<input type="image" src="icone/submit.png" onmouseover="this.src='icone/submit2.png'" onmouseout="this.src='icone/submit.png'" >
</form>
<?php
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
//MITTENTE
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[mia_email]'; // SMTP username
$mail->Password = '[mia_password]'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->FromName = $_POST['nome'].' '.$_POST['cognome'];
//DESTINATARIO
$mail->addAddress('[mia_email');
$mail->addReplyTo($_POST['email'], $_POST['nome']);
$mail->WordWrap = 50;
$mail->addAttachment('/var/tmp/file.tar.gz');
$mail->addAttachment('/tmp/image.jpg', 'new.jpg');
$mail->isHTML(true);
$mail->Subject = 'Here is the subject';
$mail->Body = $_POST['messaggio'];
if(!$mail->send()) {
echo '<p> Mail non inviata! </p>';
} else {
echo '<p> Mail inviata con successo </p>';
}
?>