首页 > 解决方案 > 提交价格表单请求后未捕获的错误

问题描述

我们正在使用开放式购物车进行网站开发,最近当用户在网站上注册说新客户已在网站上注册时,我在向管理员发送确认邮件时更改了回复邮件地址,现在我在提交另一个表单后收到错误(要求价格)。

Uncaught exception 'Exception' with message 'Error: E-Mail to required!' in /var/www/html/neon_opencart/system/library/mail.php:60 Stack trace: #0 /var/www/html/neon_opencart/catalog/controller/product/category.php(124): Mail->send() #1 [internal function]: ControllerProductCategory->index() #2 /var/www/html/neon_opencart/system/storage/modification/system/engine/action.php(44): call_user_func_array(Array, Array) #3 /var/www/html/neon_opencart/catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) #4 [internal function]: ControllerStartupRouter->index() #5 /var/www/html/neon_opencart/system/storage/modification/system/engine/action.php(44): call_user_func_array(Array, Array) #6 /var/www/html/neon_opencart/system/engine/front.php(34): Action->execute(Object(Registry)) #7 /var/www/html/neon_opencart/system/engine/front.php(29): Front->execute(Object(Action)) #8 /var/www/html/neon_opencart/system/framework.php(99): Front->dispatch(Object(Action), Object(Action)) #9 /var/www/html/neon_openca in /var/www/html/neon_opencart/system/library/mail.php on line 60

请看一下错误,这是我的代码

        $mail = new Mail();
        $mail->protocol = $this->config->get('config_mail_protocol');
        $mail->parameter = $this->config->get('config_mail_parameter');
        $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
        $mail->smtp_username = $this->config->get('config_mail_smtp_username');
        $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
        $mail->smtp_port = $this->config->get('config_mail_smtp_port');
        $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

        $mail->setTo($this->config->get('config_email'));
        $mail->setFrom($this->config->get('config_email'));
        $mail->setReplyTo('example@domain.com');
        $mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
        $mail->setSubject(html_entity_decode($this->language->get('text_new_customer'), ENT_QUOTES, 'UTF-8') . '-' . date('d-m-y'));
        //$mail->sethtml($message);
        $mail->setText($message_admin);
        $mail->send();

标签: phpopencart

解决方案


推荐阅读