private function set_from(&$mail) { $emailhelper = new FoxEmailHelper($this->Params); $config = JComponentHelper::getParams("com_foxcontact"); $submitteremailfrom = $config->get("submitteremailfrom"); $from = $emailhelper->convert($submitteremailfrom); $mail->setSender($from); $submitteremailreplyto = $config->get("submitteremailreplyto"); $replyto = $emailhelper->convert($submitteremailreplyto); // In Joomla 1.7 From and Reply-to fields is set by default to the Global admin email // but a call to setSender() won't change the Reply-to field $mail->ClearReplyTos(); $mail->addReplyTo($replyto); }
/** * @param JMail $mail */ private function set_from(&$mail) { $emailhelper = new FoxEmailHelper($this->Params); /** @var Joomla\Registry\Registry $config */ $config = JComponentHelper::getParams("com_foxcontact"); // Set a default value $default = (object) array("select" => "admin", "email" => "", "name" => ""); $submitteremailfrom = $config->get("submitteremailfrom", $default); $from = $emailhelper->convert($submitteremailfrom); $mail->setSender($from); $submitteremailreplyto = $config->get("submitteremailreplyto", $default); $replyto = $emailhelper->convert($submitteremailreplyto); // In Joomla 1.7 From and Reply-to fields is set by default to the Global admin email // but a call to setSender() won't change the Reply-to field $mail->ClearReplyTos(); $mail->addReplyTo($replyto[0], $replyto[1]); }