Problema null'utilizzo di PHPMailer()
Vorrei, poter inviare, dal mio sito, email tramite smtp ( host smtp.google.com ).
Dopo aver scaricato la libreria mi sono creato una funzione per l'invio di email:
Codice PHP:
require("PHPMailer_5.2.0/class.phpmailer.php");
function smtp_mail($to, $subject, $message, $isHtml = true)
{
$msg = $message;
if ($isHtml) {
$msg = "<body style=\"padding:15px 0\">
<table border=\"0\" style=\"margin:0 auto; width:700px; border:double #e6e6e6 3px\">
<tr>
<td height=\"100px\">
...
</td>
</tr>
<tr>
<td bgcolor=\"#f2f2f2\" style=\"padding:15px 6px\">$message</td>
</tr>
</table>
</body>";
}
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = "sevenjeak";
$mail->Password = "***";
$mail->From = "sevenjeak@gmail.com";
$mail->FromName = "Sevenjeak";
$mail->WordWrap = 50;
$mail->IsHTML($isHtml);
$mail->Subject = $subject;
$mail->Body = $msg;
$mail->AltBody = $message;
return $mail->send();
}
Ma appena provo ad inviare la mail tramite la funzione da me creata, mi restituisce questo errore:
Fatal error: Call to a member function IsSMTP() on a non-object in ********
come potrei risolvere?