K
K
Kirill Gorelov2017-06-05 14:37:54
1C-Bitrix
Kirill Gorelov, 2017-06-05 14:37:54

Custom_mail bitrix?

Guys, instead of the standard Bitrix functionality for sending mail, I use my self-written function via smtp.
The function works, but is slightly wrong.
I have the Bitrix variable #MAIL_TO# instead of the address, instead of the address.
A function called custom_mail.

function custom_mail($to, $subject, $message, $addh = "", $addp = "")
{
        // require_once __DIR__.'/phpmailer/class.phpmailer.php';
        require_once __DIR__.'/phpmailer/PHPMailerAutoload.php';
/*
подключение убрал
*/
              $to = explode(',', $to);
              foreach ($to as $value) {
              	$Mailer->addAddress($value);
              }
      $Mailer->setFrom('[email protected]', 'info');
      $Mailer->addReplyTo('[email protected]', 'Information');
      $Mailer->addAddress($to);

      $Mailer->Subject = $subject;
      $Mailer->Body    = $message;
      $Mailer->IsHTML(true);  
      $status = $Mailer->Send();
}

How can I get rid of #MAIL_TO# so that mail works properly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-06-05
@babarun

And #MAIL_TO# is not accidentally contained in the incoming $to

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question