Как правильно переделать код?
При приходе на почту - отправитель пустой
//echo $t;
$str='';
$from = "email@example.com";
$subject = $main_smarty->get_config_vars('Email_Subject');
$to = $t;
$message = sprintf($main_smarty->get_config_vars('PLIGG_InvitationEmail_Message'));
//echo $to.":".$site_mail.":".$subject."$message<br/>";
$mail = new PHPMailer();
$mail->From = $site_mail;
$mail->FromName = $main_smarty->get_config_vars('Email_SiteName');
$mail->AddAddress($to);
$mail->AddReplyTo($site_mail);
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->CharSet = 'utf-8';
$mail->Send();
при таком коде:
приходит от root@localhost
//echo $t;
$str='';
$site_mail = "info@example.com";
$subject = $main_smarty->get_config_vars('Email_Subject');
$to = $t;
$message = sprintf($main_smarty->get_config_vars('PLIGG_InvitationEmail_Message'));
//echo $to.":".$site_mail.":".$subject."$message<br/>";
$mail = new PHPMailer();
$mail->FromName = $main_smarty->get_config_vars('Email_SiteName');
$mail->AddAddress($to);
$mail->AddReplyTo($site_mail);
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->CharSet = 'utf-8';
$mail->Send();