Answer the question
In order to leave comments, you need to log in
How to make the mail sending code work?
How to change the code correctly?
When you arrive at the post office - the sender is empty
//echo $t;
$str='';
$from = "[email protected]";
$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();
//echo $t;
$str='';
$site_mail = "[email protected]";
$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();
Answer the question
In order to leave comments, you need to log in
When you arrive at the post office - the sender is emptyBecause the $site_mail variable is not defined in this code.
comes from [email protected]Well, here the sender is not indicated at all, so the default address is used .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question