Author Topic: SMTP settings file Location in etano (users are not getting confirmation mail)  (Read 5461 times)

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
hello,
                         Can you tell me how could i change my SMTP settings(username, pass)  .......... because my users are not getting confirmation mail.....my hosting service provider said change your username and pass...... than they we'll be able to receive and send emails ....

thanks
arun singh

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Etano doesn't use SMTP to send emails, it uses the PHP Mail() function for sending web mail from your host server which is pretty much considered the industry standard and is easier to set up and normally produces fewer errors than SMTP.

In order for PHP Mail() to work in Etano you must use an email addresses that is specific to your domain which is entered in the "Features and Options" section of the Etano admin.
Email address used to communicate with members: set the email address. If your site is www.mysite.com then please use my_account@mysite.com as your email address here, not my_account@yahoo.com or my_account@myothersite.com. Please check with your host how you can create email addresses for your new site.

SMTP is typically a good alternative if you want to use a 3rd party email hosting service as the sender (such as Gmail), however this would require some code changes in Etano's core files.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
hello maverick,
                        thanks you for your reply, i m using contact@mywebsite.com ....in Features and Option category..... but i am getting errors while sending emails

"mail() has been disabled for security reasons
Last query run: INSERT IGNORE INTO `dsb_user_accounts` SET `user`='abcd',`pass`=md5('12345'),`email`='ast7891@gmail.com',`membership`=2,`status`=10,`temp_pass`='688ccac2afa66843a66b4e3c27052a7b'
Array
(
   
  • => Array

        (
            [function] => error_handler
            [args] => Array
                (
                   
  • => 2
  • [1] => mail() has been disabled for security reasons
                        [2] => /home/odacoin/public_html/includes/classes/phpmailer.class.php
                        [3] => 435
                        [4] => Array
                        ...............
        "
     i talked about it with my hosting service provider.....they said to change the SMTP details that is why i was asking ...... but if this error is because of other problem....pls specify and help me to solve this....


    thanks
    arun

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Quote
[1] => mail() has been disabled for security reasons
This is saying that your host has disabled the mail() function. Some shared hosts throttle mail() or outright disable it. You'll have to contact your hosting provider about the issue. If they can't or won't help you then you''ll need to find a host that supports PHP mail().

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
....well thanks Maverick.....

i need to change my HSP(hosting service provider).

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
hello maverick,
                         they are saying  to use below script replacing the phpmail function

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "yourmailserver.com or localhost; // specify main and backup server or localhost
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "example@yourdomain.com"; // SMTP username
$mail->Password = "password"; // SMTP password //It should be same as that of the SMTP user

now can you please tell me the exact location to replace this code ......where is PHP mail() function ...
?
?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Well as I said before, in order to use SMTP it will require some custom code changes in Etano's core files.

Below are some instructions based on using Gmail as the SMTP mail host in Etano, you'll just need to tweak or customize the settings to use whatever your SMTP host provides you with.

Download the most recent version of PHPMailer from https://github.com/PHPMailer/PHPMailer

Extract the zip files and then locate and upload ONLY the class.phpmailer.php and class.smtp.php files from the package to your /includes/classes/ folder.

Then open the /includes/general_functions.php file
NOTE: You'll need to replace code in 2 locations within this file.
===================================================================================
Locate the following code starting at about line 193 and also starting at about line 340:
Code: [Select]
require_once _BASEPATH_.'/includes/classes/phpmailer.class.php';
$mail=new PHPMailer();
$mail->IsHTML(true);
$mail->From=$config['mail_from'];
$mail->Sender=$config['mail_from'];
$mail->FromName=_SITENAME_;
if ($config['mail_crlf']) {
$mail->LE="\r\n";
} else {
$mail->LE="\n";
}
$mail->IsMail();

Replace the above code with the following code (in both locations as mentioned above):
Code: [Select]
require_once _BASEPATH_.'/includes/classes/class.phpmailer.php';
$mail=new PHPMailer();
$mail->IsSMTP();  // telling the class to use SMTP
        $mail->Mailer = "smtp";
        $mail->Host = "ssl://smtp.gmail.com";
        $mail->Port = 465;
        $mail->SMTPAuth = true; // turn on SMTP authentication
        $mail->Username = "yourusername@gmail.com"; // Gmail username/email
        $mail->Password = "yourpassword"; // Gmail password
$mail->IsHTML(true);
$mail->From=$config['mail_from'];
$mail->Sender=$config['mail_from'];
$mail->FromName=_SITENAME_;
if ($config['mail_crlf']) {
$mail->LE="\r\n";
} else {
$mail->LE="\n";
}
$mail->IsSMTP();  // telling the class to use SMTP



Login to your Etano Admin >> Features and Options and change your email address in the "Email address used to communicate with members" section to your Gmail email (or your host server email) address.

=========================================================================

If you get ... "SMTP Error: Could not authenticate." It could mean your open_ssl extension is not enabled.

Uncomment the following in your php.ini file or ask your host to enable it for you.
Code: [Select]
extension=php_openssl.dll
If emails aren't being sent or if you get ... "SMTP Error: Could not authenticate. It could mean that your host requires secure SMTP authentication. In which case you will need to try also including these 2 lines:
Code: [Select]
$mail->SMTPSecure = 'tls';    // Enable secure encryption, use tls or ssl
$mail->Port = 587;               // TCP port to connect, tls=587, ssl=465
You may need to ask your host what settings they use or that they require.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
thanks maverick,
                           i changed the code ...... now users are getting confirmation mail. ....but my contact form is still not working ..... it's showing the error

"Your message could not be sent: Language string failed to load: instantiate"

....could you please solve this issue too...

thanks
arun

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Try also making the same code changes as mentioned above and apply them to the following files:

/processors/contact.php (starting at about line #76)

tools/cron/jobs/5/6send_queue_mail.php (starting at about line #11)

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

arunsingh121

  • Active Member
  • ***
  • Posts: 26
  • Karma: +0/-0
thanks maverick,
                          contact form is now working properly....thank you very much :)

adukale

  • Confirmed Member
  • **
  • Posts: 11
  • Karma: +0/-0
Hello
 while changing users email in my_setting page it is not happening. browser just goes to email_change.php but didn't returns to my_setting.php. Error_log in processors directory shows "PHP Fatal error:  Class 'SMTP' not found in /home/adwaitx1/public_html/adwait/includes/classes/class.phpmailer.php on line 1194".

and for the record i followed your instructions above to use SMTP.

aussie7

  • Confirmed Member
  • **
  • Posts: 5
  • Karma: +0/-0
just for someone out there I had a similar problem and fixed it by

uploading the following files from the package

- class.phpmailer.php
- class.smtp.php

to your /includes/classes/ folder.

and now have working contact form :)

nmccainjr

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Hello,

I tried to make these change for SMTP, but I get an 500 error on the site

Thanks
Norman

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is. Therefore something must have been done incorrectly and the only suggestion I have is to try carefully going through all the steps again.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.