We are using open cart for website development and recently i have changed Reply To mail address as i wanted while sending confirmation mail to admin when a user registered on website saying new customer has registered on website,now i am getting the error after submitting another form (request for Price).
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
Please have a look at the error,here is my code
$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();