D
D
Dim Boy2016-01-24 21:27:44
PHP
Dim Boy, 2016-01-24 21:27:44

Why doesn't PHPmail send FromName?

There is no FromName in the incoming letter , only email says:

$to = $user->user_email;
        $subject = $main_smarty->get_config_vars("PLIGG_PassEmail_Subject");
        $body = "html mail";
                
        $headers = 'From: ' . $main_smarty->get_config_vars("PLIGG_PassEmail_From") . "\r\n";
        $headers .= "Content-type: text/html; charset=utf-8\r\n";
        
        if(phpnum()>=5)
            require("libs/class.phpmailer5.php");
        else
            require("libs/class.phpmailer4.php");	
        
        $mail = new PHPMailer();
        $mail->From = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
        $mail->FromName = $main_smarty->get_config_vars('PLIGG_PassEmail_Name');
        $mail->AddAddress($to);
        $mail->AddReplyTo($main_smarty->get_config_vars('PLIGG_PassEmail_From'));
        $mail->IsHTML(true);
        $mail->Subject = $subject;
        $mail->CharSet = 'utf-8';
        $mail->MsgHTML( $body );
        
        if (mail($to, $subject, $body, $headers))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
entermix, 2016-01-24
@twix007

And where is the $mail variable used when sending?
Need like this:
if($mail->send())

K
Kirill, 2016-01-24
@quant78

indeed there is no mail variable and there should not be spaces in from

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question