OsCommerce SMTP
installation guide of OsCommerce with Mailazy SMTP
Prerequisites
You need to complete these given prerequisites, you can skip the step if you have already completed.
- Sign up for a Mailazy account.
- Complete Domain Authentication.
- Generate the Mailazy Access Key
Configuration:
Note: ( Please backup your files before proceeding with the following steps)
To install Mailazy:
- Download MailazyAPI Class file: https://github.com/mailazy/mailazy-php/blob/main/src/Mailazy/
- Find files mailazyAPI.php from mailazy-php package.
Then upload them into these folders:
.../admin/includes/classes
.../includes/classes/
- Access the following files and edit them according to the examples provided below:
.../includes/classes/email.php
.../admin/includes/classes/email.php
Inside each of the email.php files you have to locate the following section around line 519:
if (EMAIL_TRANSPORT == ‘smtp’) {
Please add following code before above lines:
require_once(DIR_WS_CLASSES . "mailazyAPI.php");
$mailazyClient = new mailazyAPI();
$mailazyClient->setApikey(MAILAZY_API_KEY);
$mailazyClient->setApisecret(MAILAZY_API_SECRET);
$mailazyClient->isHTML(true);
$mailazyClient->addAddress($to_addr,$to_name);
$mailazyClient->setSubject($subject);
$mailazyClient->setBody($this->output);
$mailazyClient->setFrom('username@domain.com');
return $mailazyClient->send();
The changes should be applied to both of the email.php files so that both the front-end and back-end of your application could successfully send emails.
Test
Register an account first ,then Go to Administrative Panel > Tools > Send Email to have a try