OsCommerce supports the use of SMTP to send email, but does not allow specification of a username and password for outgoing authentication which is required when sending mail from our servers.  If you wish to use SMTP to send mail, this guide will walk you through how to set up SMTP with your shopping cart.   It is best to use an email address that you created in your cPanel on our server for the SMTP setup, but you can use your outgoing email settings for most other mail providers to send emails.

First thing to do is log in to the administrative panel, then go to Configuration ~> Email options and choose "SMTP" as the Transport Method.

Also verify these other settings:

  • Email Line Feels: LF
  • Use MIME EMail when sending email: YES
  • Verify E-Mail Addresses Through DNS : FALSE
  • Use MIME HTML When Sending Emails: FALSE
Also check the the General Store configuration to see that the Email Address and Email From fields are the same as the outgoing email address you'll be using for the setup.

You'll need to install a 3rd party script called phpMailer. As with any other time, please make a backup copy of any files you are changing in case something goes wrong!

How do I install phpMailer?

1. Download a copy of phpMailer:

Direct Download of PHPMailer

2. There are two files, class.phpmailer.php and class.smtp.php. Open the FTP site to the OScommerce installation, then upload them both into these folders:

.../admin/includes/classes
.../includes/classe

3. There are two files in OsCommerce that you need to edit:

.../includes/classes/email.php
.../admin/includes/classes/email.php

4. In the email.php file, locate this section: (line 519)

if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $$
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this$
}
}

5. You'll need to comment out some of these lines, so they look like this:

if (EMAIL_TRANSPORT == 'smtp') {
// return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $$
// } else {
// return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this$
// }
// }

6. Then copy and paste this code directly below those lines. Be sure to change the Host, Username, and Password fields to match the outgoing mail server.  When sending from our systems, please just use 'localhost' as the host, and your entire email address as the username.

 

require_once(DIR_WS_CLASSES . "class.phpmailer.php");
$pMail = new PHPMailer();

$pMail->From = $from_addr;
$pMail->FromName = $from_name;

$pMail->IsSMTP();
$pMail->Host = "mail.yourdomain.com"; // replace with your smtp server
$pMail->Username = " This email address is being protected from spambots. You need JavaScript enabled to view it. "; // replace with your smtp username (if SMTPAuth is true)
$pMail->Password = "password"; // replace with your smtp password (if SMTPAuth is true)
$pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication

$pMail->Subject = $subject;
$pMail->Body = $this->output;
$pMail->AddAddress($to_addr, $to_name);
$pMail->IsHTML(false);

return $pMail->Send();

$pMail->ClearAddresses();
$pMail->ClearAttachments();

 

7. This needs to be done for both email.php files in order to get the user-side and back end emailing to work. There is a sample email.php available here: http://www.v-nessa.net/imh_files/email.phps

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Help Center:
Email Address
Optional, but our team may contact you for more information.
Did you find this article helpful?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

Update to SSL Certificates - Certificate Warnings
1969-12-31 11:00 am EST
Hits: 636

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.