Contributions
PHPMailer for OsCommerce
PHPMailer lets the store owner send html email instead of plain text email that OsCommerce provided by default. PHPMailer also provides SMTP authentication so the user can use SMTP running on different server.
Hope this will help someone ;-{)
Expand All / Collapse All
If you need authentification on the mail server you have to add some few features to be allowed to send mails. This is compareable to the feature "Authentificate before SMTP" in your local mail program.
The PHPmailer Class uses the attributes Username, Password and SMTPAuth. We will fill them with the necessary information.
Step 1:
Install "PHPMailer for OsCommerce" as it is explained before.
Step 2:
In the files
/content/includes/configure.php
/content/admin/includes/configure.php
find:
define('SMTP_MAIL_SERVER', 'mail.yourmailserver.com');
define('SMTP_PORT_NUMBER', '25');
define('SMTP_SENDMAIL_FROM', 'valid_email@yourmailserver.com ');
define('SMTP_FROMEMAIL_NAME', 'store owner name');
and replace with:
define('SMTP_MAIL_SERVER', 'mail.yourmailserver.com'); define('SMTP_PORT_NUMBER', '25');
define('SMTP_SENDMAIL_FROM', 'valid_email@yourmailserver.com ');
define('SMTP_SENDMAIL_USERNAME', 'valid username for mail server');
define('SMTP_SENDMAIL_PASSWORD', 'valid password for mail server');
define('SMTP_SENDMAIL_SMTPAUTH', 'true');
define('SMTP_FROMEMAIL_NAME', 'store owner name');
Step 3:
In the files:
/content/includes/functions/general.php
/content/admin/includes/functions/general.php
find:
$message->Host = SMTP_MAIL_SERVER; // SMTP server
and replace with:
$message->Host = SMTP_MAIL_SERVER; // SMTP server
$message->Username = SMTP_SENDMAIL_USERNAME; // SMTP server username
$message->Password = SMTP_SENDMAIL_PASSWORD; // SMTP server password
$message->SMTPAuth = "true";
Done.
digaovr did a nice work and saved me from some troubles.
Unfortunately the HTML output of the code is not so nice as espected. I did a little modification to digaovr's code in order to better format the HTMl output of the sent e-mails.
After applying the mods proposed by digaovr change in:
catalog/includes/classes/email.php
catalog/admin/includes/classes/email.php
Find:
$pMail->Body = $this->output;
Replace with:
$pMail->Body = '<font face="Verdana" size="1">'.nl2br($this->output).'</font>';
Use your preferred font, I choosed Verdana with a size of 1.
Hope this helps.
Com essa contribuição, você pode enviar emails da sua loja (cadastro, compras-teste,etc) em localhost, ou seja, com a loja instalada no seu computador.
======================================
With this contribuition, you can send emails of its store (create_account, orders, newsletters,etc) in localhost, that is, in your local machine with the store instaled in your computer.
PHPMailer lets the store owner send html email instead of plain text email that OsCommerce provided by default. PHPMailer also provides SMTP authentication so the user can use SMTP running on different server.
Hope this will help someone ;-{)
Note: Contributions are used at own risk.