$body = "test";
date_default_timezone_set('Europe/Warsaw');
require_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->Body = $body;
$mail->IsSMTP(); // telling the class to use SMTP
$mail->CharSet="utf-8";
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent
//$mail->Host = "smtp.wp.pl"; // sets the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "nazwa_usera"; // SMTP account username
$mail->Password = "haslo"; // SMTP account password
$mail->SetFrom('nadawca_email', 'nadawca');
$mail->AddReplyTo('nadawca_email', 'nadawca');
$mail->Subject = "Temat";
$mail->AddAddress($email, $email);
$mail->AddEmbeddedImage('images/logo-email.jpg', 'logoimg', 'images/logo-email.jpg');
if($mail->Send())
{
}
Oczywiście nazwe usera, haslo itd mam wpisane swoje z Wirtualnej Polski