Post by N1kko » Thu Apr 02, 2015 8:33 pm

Upgraded to latest version and getting this error on register

Notice: Error: E-Mail to required! in /system/library/mail.php on line 61

Thanks for any help
Last edited by N1kko on Thu Apr 09, 2015 10:48 pm, edited 1 time in total.

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by viethemes » Thu Apr 02, 2015 10:26 pm

Could you provide your site url, so we can take a look at the problem closer?

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by apostolos » Fri Apr 03, 2015 4:26 am

PHP Notice: Error: E-Mail to required! in /home/pelekanftp/public_html/store/system/library/mail.php on line 61

I have the same error when I am trying to buy a product in this page: http://pelekan.com.gr/store/checkout-finalize/

I upgraded yesterday and everything else is ok

Thanks for any help too :)

Go to work, get married have some kids, pay your taxes pay your bills, watch your tv follow fashion, act normal obey the law, and repeat after me: I am free!!!


User avatar
Newbie

Posts

Joined
Fri Apr 03, 2015 4:20 am
Location - Greece

Post by vbrunets » Fri Apr 03, 2015 8:39 am

I have the same problem! Error in line 61.

But before this I had a lot of other mail errors trying to register an account.

I can't send any mail using opencart 2.0.2. Before this I had no problems on opencart 1.5.6

Please help! Thanks! Site url easymag.com.ua

Newbie

Posts

Joined
Fri Apr 03, 2015 8:37 am

Post by apostolos » Fri Apr 03, 2015 9:18 am

So... I think that i found my problem and maybe @N1kko's problem The error came from extension http://www.opencart.com/index.php?route ... n_id=21113 Show captcha on registration page.

I changed this in xml:

<file name="catalog/controller/account/register.php">
<operation error="log">
<search position="after" error="log"><![CDATA[if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {]]></search>
<add><![CDATA[unset($this->session->data['captcha']);]]></add>
</operation>

to this:

<file name="catalog/controller/account/register.php">
<operation error="log">
<search position="before" error="log"><![CDATA[unset($this->session->data['guest']);]]></search>
<add><![CDATA[unset($this->session->data['captcha']);]]></add>
</operation>

end everyting working fine now!

Go to work, get married have some kids, pay your taxes pay your bills, watch your tv follow fashion, act normal obey the law, and repeat after me: I am free!!!


User avatar
Newbie

Posts

Joined
Fri Apr 03, 2015 4:20 am
Location - Greece

Post by pushpendrasingh » Fri Apr 03, 2015 4:28 pm

When i try to do checkout with guest account or i want to register into site, i have a popup with error "Customer email is required”.

Opencart Website Developer


Posts

Joined
Wed Apr 01, 2015 1:44 pm

Post by aljawaid » Sun Apr 05, 2015 4:41 am

apostolos wrote:So... I think that i found my problem and maybe @N1kko's problem The error came from extension http://www.opencart.com/index.php?route ... n_id=21113 Show captcha on registration page.

I changed this in xml:

<file name="catalog/controller/account/register.php">
<operation error="log">
<search position="after" error="log"><![CDATA[if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {]]></search>
<add><![CDATA[unset($this->session->data['captcha']);]]></add>
</operation>

to this:

<file name="catalog/controller/account/register.php">
<operation error="log">
<search position="before" error="log"><![CDATA[unset($this->session->data['guest']);]]></search>
<add><![CDATA[unset($this->session->data['captcha']);]]></add>
</operation>

end everyting working fine now!
I don't use that extension but still have the same problem :(

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by aljawaid » Sun Apr 05, 2015 4:47 am

I get the error when registering a customer /system/library/mail.php on line 61

Clean installation of v2.2.0 with only import/export extension and ftp extension.

my line 61 in the file is this...

Code: Select all

public function send() {
		if (!$this->to) {
			trigger_error('Error: E-Mail to required!');
			exit();
		}
Strange thing is, in the dashboard it saves the customer and sends admin e-mail. So it seems a front end type of error.

Anyone have any ideas what might be going on?

Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.


Active Member

Posts

Joined
Fri Oct 10, 2014 10:33 pm
Location - UK

Post by N1kko » Wed Apr 08, 2015 11:54 pm

Bump still having issue with this.

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 3:20 am

N1kko wrote:Bump still having issue with this.
In the latest version the variable name for smtp mail hostname was changed so it can be related to that.
Try checking your store email settings in System->Settings->YOUR STORE
then in general tab,check the e-mail field. In Mail tab check all the fields if they are correct and not blank.

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm


Post by N1kko » Thu Apr 09, 2015 2:31 pm

Thanks fields was blank I have now sorted that but a new problem after registering is...

Code: Select all

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/public_html/cw/system/library/mail.php on line 168Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/public_html/cw/system/library/mail.php on line 168Notice: Error: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) in /home/public_html/cw/system/library/mail.php on line 171

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 5:19 pm

Seems like in the new OC release somebody have forgotten to change mail_smtp_host to mail_smtp_hostname in ALL files!
But Im not surprised, SMTP mail transport in OC have never worked good from the beginning :P

You have two options look for config_mail_smtp_host and change it to config_mail_smtp_hostname in all files (about 30 of them) or wait till 2.0.2.1 release because it seems that it is fixed there.
There is also a third way, temporary revert back config_mail_smtp_hostname in admin settings files to config_mail_smtp_host (JUST 2 files to edit).

Im posting the last solution here because it is the easiest one.

Edit this file admin/controller/setting/setting.php and find the following code:

Code: Select all

if (isset($this->request->post['config_mail_smtp_hostname'])) {                                                                                                                                                              
$data['config_mail_smtp_hostname'] = $this->request->post['config_mail_smtp_hostname'];                                                                                                                              
else {                                                                                                                                                                                                                     
$data['config_mail_smtp_hostname'] = $this->config->get('config_mail_smtp_hostname');                                                                                                                                
}  
now change all config_mail_smtp_hostname occureces to config_mail_smtp_host so the code will look like:

Code: Select all

if (isset($this->request->post['config_mail_smtp_host'])) {                                                                                                                                                              
$data['config_mail_smtp_host'] = $this->request->post['config_mail_smtp_host'];                                                                                                                              
else {                                                                                                                                                                                                                     
$data['config_mail_smtp_host'] = $this->config->get('config_mail_smtp_host');                                                                                                                                
} 
Now edit this file:
admin/view/template/setting/setting.tpl
find this code:

Code: Select all

<label class="col-sm-2 control-label" for="input-mail-smtp-hostname"><span data-toggle="tooltip" title="<?php echo $help_mail_smtp_hostname; ?>"><?php echo $entry_mail_smtp_hostname; ?></span></label>                     
                <div class="col-sm-10">                                                                                                                                                                                                      
                  <input type="text" name="config_mail_smtp_hostname" value="<?php echo $config_mail_smtp_hostname; ?>" placeholder="<?php echo $entry_mail_smtp_hostname; ?>" id="input-mail-smtp-hostname" class="form-control" />  
and change it to this:

Code: Select all

<label class="col-sm-2 control-label" for="input-mail-smtp-host"><span data-toggle="tooltip" title="<?php echo $help_mail_smtp_hostname; ?>"><?php echo $entry_mail_smtp_hostname; ?></span></label>                         
                <div class="col-sm-10">                                                                                                                                                                                                      
                  <input type="text" name="config_mail_smtp_host" value="<?php echo $config_mail_smtp_host; ?>" placeholder="<?php echo $entry_mail_smtp_hostname; ?>" id="input-mail-smtp-host" class="form-control" /> 



That should do the trick.
Ah, and you need to set SMTP Hostname in the admin again!

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm


Post by N1kko » Thu Apr 09, 2015 5:33 pm

Thanks for the help with this issue. Even if mail is set to mail and not smtp I get this error

Code: Select all

Notice: Error: E-Mail to required! in /home/public_html/cw/system/library/mail.php on line 61

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 6:01 pm

Do you get it on contact page or in other pages?
I cant reproduce this error with clean 2.0.2.0 install on contact page.

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm


Post by N1kko » Thu Apr 09, 2015 6:04 pm

Contact page works fine.

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 6:07 pm

Sweet more and more errors.
So where do you get this
Error: E-Mail to required! in /system/library/mail.php on line 61
error?

And disable captcha temporary (in your store system->settings->your_store in the Google tab) and then try to send contact form. Lets see what error it is giving then :)

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm


Post by N1kko » Thu Apr 09, 2015 6:12 pm

Disabled captcha and contact form works.

this
Error: E-Mail to required! in /system/library/mail.php on line 61

happens when I register an account only

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 6:26 pm

OK, I think I have found it.
Edit this file:
catalog/model/account/customer.php
The around line 80 you will have this text:

Code: Select all

$mail->setSubject($this->language->get('text_new_customer'));                                                                                 
$mail->setText($message);      
$mail->send();                                                                                                                                
                                         
// Send to additional alert emails if new account email is enabled 
Add this line "$mail->setTo($this->config->get('config_email'));" above "$mail->send();"
So the code will look like:
$mail->setText($message);

Code: Select all

$mail->setSubject($this->language->get('text_new_customer'));                                                                                 
$mail->setText($message);    
$mail->setTo($this->config->get('config_email'));                                                                                     
$mail->send();                                                                                                                                
 // Send to additional alert emails if new account email is enabled       
Let me know if it is working now.

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm


Post by N1kko » Thu Apr 09, 2015 6:31 pm

Thanks but still no go, same error different line

Code: Select all

Notice: Error: E-Mail from required! in /home/public_html/cw/system/library/mail.php on line 66

User avatar
New member

Posts

Joined
Tue Dec 15, 2009 1:19 am

Post by osexperts » Thu Apr 09, 2015 6:37 pm

OK, so in the same file you edited in the previous post (customer.php)
below the line you added, add those two:

Code: Select all

$mail->setFrom($this->config->get('config_email')); 
$mail->setSender($this->config->get('config_name'));


so it should look like:

Code: Select all

$mail->setSubject($this->language->get('text_new_customer'));                                                                                 
$mail->setText($message);    
$mail->setTo($this->config->get('config_email'));       
$mail->setFrom($this->config->get('config_email')); 
$mail->setSender($this->config->get('config_name'));
$mail->send();                                                                                                           
                                                                                                                                                                      
// Send to additional alert emails if new account email is enabled  

OpenSource Experts - Web design and development
OC 1.5.x and 2.x SMTP email from field error fix


User avatar
New member

Posts

Joined
Sat Mar 28, 2015 11:47 pm

Who is online

Users browsing this forum: No registered users and 67 guests