Jump to content

Archived

This topic is now archived and is closed to further replies.

bscanzoni

SMTP Authentication and OSCommerce

Recommended Posts

Sorry to complain again but I have noticed that the order confirmation mail does not have a clickable link back to the shop so you can look at your order status. The link is there but you have to copy and paste it to your browser if you want to look at it.

 

Seems to be the same in all type of mails that has such links, for example if you want to have a new password.

 

Can that be something that has to do with the two email.php files?

Share this post


Link to post
Share on other sites

Set to text the mail system in oscommerce configuration administration site. (Use MIME HTML When Sending Emails - False)


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

1. Download https://github.com/PHPMailer/PHPMailer (zip)

2. extract to a folder

3. upload the unzipped files to oscommerce site into /ext/modules/PHPMailer/ folder

4. Download email.php for catalog site from here https://github.com/Gergely/oscommerce2-1/blob/30ad1cb48326221eceb43a0166be33b91c0668fd/catalog/admin/includes/classes/email.php

 

5. rename on the site includes/classes/email.php to old_email.php

6. upload the new previous downloaded email.php into includes/classes/

7. download for admin email.php class from here https://github.com/Gergely/oscommerce2-1/blob/30ad1cb48326221eceb43a0166be33b91c0668fd/catalog/includes/classes/email.php

8. rename admin includes/classes/email.php to old_email.php

9. upload for admin email.php into admin/includes/classes/email.php

10. Add new configuration functions into admin/includes/functions/general.php

before appox in 808 line

 

function tep_cfg_password($password) {
return preg_replace("|.|", "*", $password);
}
function tep_cfg_input_password($password) {
return tep_draw_password_field('configuration_value', $password);
}
before this note:

 

 

 

11. run sql update

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP hosts', 'EMAIL_SMTP_HOSTS', '', 'Assign SMTP host senders', '12', '6', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('SMTP authentication', 'EMAIL_SMTP_AUTHENTICATION', 'true', 'Do you want authenticated SMTP server?', '12', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('SMTP Password', 'EMAIL_SMTP_PASSWORD', '', 'Add SMTP Password for SMTP protocol', '12', '8', 'tep_cfg_password', 'tep_cfg_input_password(', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP User', 'EMAIL_SMTP_USER', '', 'Add SMTP user for SMTP protocol', '12', '9', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP Reply To', 'EMAIL_SMTP_REPLYTO', '', 'Add SMTP reply to address', '12', '10', now());
12. config SMTP settings in admin configuration email section (set to SMTP the email section)

- add smtp server

- add SMTP user

- add smtp password

- add smtp email address

 

Note: For gMail smtp function need to modify EMAIL_TRANSPORT defined constant's set_function field by hand

The new value should be

tep_cfg_select_option(array(\'gmail\', \'sendmail\', \'smtp\'),
but this altered field value not important now.

 

Latest summered commit here: https://github.com/Gergely/oscommerce2-1/commit/b02e44c5b559419f75ac7ed1301de07989cec622

 

hello

use oscommerce 2.3.4

 

I've done all the steps carefully

But

I get the message

Fatal error: Class 'SMTP' not found in ....../public_html/ext/modules/PHPMailer/class.phpmailer.php on line 1194

 

thanks

 

Share this post


Link to post
Share on other sites

I found this line to the 2 files email.php added

require_once '../ext/modules/PHPMailer/PHPMailerAutoload.php';

this error not show

Fatal error: Class 'SMTP' not found in ....../public_html/ext/modules/PHPMailer/class.phpmailer.php on line 1194

 

and send email Success

i can send email admin panel for user

but  Change order not send email for user !

and Contact Us page not send email for admin shop !

Please Help Me

thank you

Share this post


Link to post
Share on other sites

Hi @@bkiani,

Probably your SMTP settings is bad.
This module not allow to send double email so you should set only one email address at admin setting without any names.

For example: myemail@@address.com

Bad: <helloword> my@@address.com


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Hello Gergely

Thanks for the answer

 

my setting  :

 

SMTP hosts = mail.mydomain.com

SMTP authentication = true

SMTP Password = mypass

SMTP User = admin@mydomain.com

SMTP Reply To = admin@mydomain.com

Share this post


Link to post
Share on other sites

What is your email address, send extra email and email from?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

@@newburns

 

your configuration is not allow to reach /var/www/store/ext/modules/PHPMailer/class.phpmailer.php The /var/www/store/admin/ext/modules/PHPMailer/class.phpmailer.php is bad path.

try to change in admin/includes/classes/email.php

  require_once '../ext/modules/PHPMailer/class.phpmailer.php';

to:

  require_once DIR_FS_DOCUMENT_ROOT . 'ext/modules/PHPMailer/class.phpmailer.php';

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

@@Gergely,

 

I followed your directions to a T on page 3, including the email.php directions.  However in your directions the email.php files you link to are for oscommerce 2.1.  I have oscommerce 2.3.4.  So when I use the 2 you provided NOTHING works I get an error 500.  When I go back to my original email.php files it all works including the ability to define all the SMTP stuff in the admin panel, however  no emails are sent still.  Maybe you could modify the original email.php files for 2.3.4 to work with everything else you provided in your directions?

 

Otherwise great work I'm at least further along in getting this to work than I was before.  LOL

Share this post


Link to post
Share on other sites

 

@@newburns

 

your configuration is not allow to reach /var/www/store/ext/modules/PHPMailer/class.phpmailer.php The /var/www/store/admin/ext/modules/PHPMailer/class.phpmailer.php is bad path.

 

try to change in admin/includes/classes/email.php

  require_once '../ext/modules/PHPMailer/class.phpmailer.php';

to:

  require_once DIR_FS_DOCUMENT_ROOT . 'ext/modules/PHPMailer/class.phpmailer.php';

This works, but it is not changed in GitHub.

This also works on bootstrap 2.3.4

Share this post


Link to post
Share on other sites

Also, PHPMailer Release 5.8 must be used.

The master.zip for Master Branch PHPMailer results in this error

[Wed Nov 12 19:14:46 2014] [error] [client 10.1.14.185] PHP Fatal error:  Class  'SMTP' not found in /var/www/webstore/admin/ext/modules/PHPMailer/class.phpmaile r.php on line 1196, referer: http://store.mtrosemedia.org/admin/aas.php

Share this post


Link to post
Share on other sites

@@newburns

 

Thanks for the report. Later this will be built in.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Do you have phpMyAdmin?

If so, select your database, go to SQL tab, and copy and paste the SQL changes.

Share this post


Link to post
Share on other sites

Gergely,

 

this is a fantastic post! I followed every single step and got my client's website smtp set up to work properly THANK YOU for this, the only issue I have now is that I am unable to send out emails to all customers via the admin panel, I get no errors after I send an email to all customers and I do get the prompt "success.gif Notice: Email sent to: All Customers" however no one ever gets an email can you tell me what the problem is?

Share this post


Link to post
Share on other sites

Gergely,

 

Per your previous comment (#28) I made an update to the sender email from "first name last name < email@yourdomain.com > " to just simply "email@yourdomain.com" and that did the trick! I am now able to send emails to all customers/registered users

Share this post


Link to post
Share on other sites

Earlier on in this topic I saw a conversation from Henry where he talked about Mandrill.

I am very interested to understand how to integrate Mandrill with Oscommerce but I am unable to fully understand the code he posted.

Share this post


Link to post
Share on other sites

This has worked perfectly until we changed to a new server with PHP 5.6.14. Now it's not possible to send mail in contact us or when making an orders. So I updated to the latest PHPMailer files. What I did was to add the following updated files to /ext/modules/PHPMailer/

- class.phpmailer.php
- class.pop3.php
- class.smtp.php
- PHPMailerAutoload.php

 

Now I get the following error:

Fatal error: Class 'SMTP' not found in /home/flotecmari2/public_html/ext/modules/PHPMailer/class.phpmailer.php on line 1443

 

In line 1443 I found this: $this->smtp = new SMTP;

 

Is there some more files to update? Or maybe I don't need to update at all?

Share this post


Link to post
Share on other sites

×