{"id":57,"date":"2011-08-26T12:37:19","date_gmt":"2011-08-26T16:37:19","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/08\/26\/setting-up-smtp-with-oscommerce\/"},"modified":"2021-08-16T23:53:18","modified_gmt":"2021-08-17T03:53:18","slug":"setting-up-smtp-with-oscommerce","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/","title":{"rendered":"Setting up SMTP with osCommerce"},"content":{"rendered":"<p>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.<\/p>\n<p>If you are on a server that does not allow the PHP mail() function or you just wish to use SMTP to send mail, this guide will walk you through how to set up SMTP with your shopping cart.<\/p>\n<p>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.<\/p>\n<p>First thing to do is log in to the administrative panel, then go to\u00a0<strong>Configuration<\/strong> ~&gt;\u00a0<strong>Email options<\/strong> and choose\u00a0<strong>&#8220;SMTP&#8221;<\/strong> as the Transport Method.<\/p>\n<p>Also verify these other settings:<\/p>\n<p>Email Line Feels: <strong>LF<\/strong><br \/>\nUse MIME EMail when sending email: <strong>YES<\/strong><br \/>\nVerify E-Mail Addresses Through DNS\u00a0: <strong>FALSE<\/strong><br \/>\nUse MIME HTML When Sending Emails: <strong>FALSE<\/strong><\/p>\n<p>Also check the the General Store configuration to see that the\u00a0<strong>Email Address<\/strong> and\u00a0<strong>Email From\u00a0<\/strong>fields are the same as the outgoing email address you&#8217;ll be using for the setup.<\/p>\n<p>You&#8217;ll need to install a 3rd party script called\u00a0<strong>phpMailer<\/strong>. As with any other time, please make a backup copy of any files you are changing in case something goes wrong!<\/p>\n<h2>To install phpMailer:<\/h2>\n<p>1.<a href=\"\/support\/email\/download-phpmailer\/\"> Download a copy of phpMailer<\/a><\/p>\n<ol>\n<li>There are two files,\u00a0<strong>class.phpmailer.php<\/strong> and\u00a0<strong>class.smtp.php<\/strong>. Open the FTP site to the OScommerce installation, then upload them both into these folders:<\/li>\n<\/ol>\n<div><strong>&#8230;\/admin\/includes\/classes<\/strong><br \/>\n<strong>&#8230;\/includes\/classes\/<\/strong><\/div>\n<ol>\n<li>There are two files in OsCommerce that you need to edit:<\/li>\n<\/ol>\n<p><strong>&#8230;\/includes\/classes\/email.php <\/strong><br \/>\n<strong>&#8230;\/admin\/includes\/classes\/email.php<\/strong><\/p>\n<p>In the email.php file, locate this section: (line 519)<\/p>\n<div class=\"code_block\"><strong> if (EMAIL_TRANSPORT == &#8216;smtp&#8217;) <\/strong><\/div>\n<div class=\"code_block\"><strong>{<\/strong><br \/>\n<strong> return mail($to_addr, $subject, $this-&gt;output, &#8216;From: &#8216; . $from . $this-&gt;lf . &#8216;To: &#8216; . $to . $this-&gt;<\/strong> <strong>lf . implode($this-&gt;lf, $$<\/strong><br \/>\n<strong> } <\/strong><\/div>\n<div class=\"code_block\"><strong>else {<\/strong><br \/>\n<strong> return mail($to, $subject, $this-&gt;output, &#8216;From: &#8216;.$from.$this-&gt;lf.implode($this-&gt;lf, $this-&gt;headers).$this-&gt;lf.implode($this$<\/strong><br \/>\n<strong> }<\/strong><br \/>\n<strong> }<\/strong><\/div>\n<p>You&#8217;ll need to comment out some of these lines, so they look like this:<\/p>\n<div class=\"code_block\"><strong> if (EMAIL_TRANSPORT == &#8216;smtp&#8217;) {<\/strong><br \/>\n<strong>\/\/ return mail($to_addr, $subject, $this-&gt;output, &#8216;From: &#8216; . $from . $this-&gt;lf . &#8216;To: &#8216; . $to . $this-&gt;lf . implode($this-&gt;lf, $$<\/strong><br \/>\n<strong>\/\/ } else {<\/strong><br \/>\n<strong>\/\/ return mail($to, $subject, $this-&gt;output, &#8216;From: &#8216;.$from.$this-&gt;lf.implode($this-&gt;lf, $this-&gt;headers).$this-&gt;lf.implode($this$<\/strong><br \/>\n<strong>\/\/ }<\/strong><br \/>\n<strong>\/\/ }<\/strong><\/div>\n<p>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.\u00a0 When sending from our systems, please just use <strong>&#8216;localhost<\/strong>&#8216; as the host, and your entire email address as the username.<\/p>\n<div class=\"code_block\"><strong>require_once(DIR_WS_CLASSES . &#8220;class.phpmailer.php&#8221;);<\/strong><br \/>\n<strong>$pMail = new PHPMailer();<\/strong><br \/>\n<strong>$pMail-&gt;From = $from_addr;<\/strong><br \/>\n<strong>$pMail-&gt;FromName = $from_name;<\/strong><br \/>\n<strong>$pMail-&gt;IsSMTP();<\/strong><br \/>\n<strong>$pMail-&gt;Host = &#8220;mail.example.com&#8221;; \/\/ replace with your smtp server<\/strong><br \/>\n<strong>$pMail-&gt;Username = &#8220;<a href=\"mailto:email@example.com\">email@example.com<\/a>&#8220;; \/\/ replace with your smtp username (if SMTPAuth is true)<\/strong><br \/>\n<strong>$pMail-&gt;Password = &#8220;password&#8221;; \/\/ replace with your smtp password (if SMTPAuth is true)<\/strong><br \/>\n<strong>$pMail-&gt;SMTPAuth = true; \/\/ true\/false &#8211; turn on\/off smtp authentication<\/strong><br \/>\n<strong>$pMail-&gt;Subject = $subject;<\/strong><br \/>\n<strong>$pMail-&gt;Body = $this-&gt;output;<\/strong><br \/>\n<strong>$pMail-&gt;AddAddress($to_addr, $to_name);<\/strong><br \/>\n<strong>$pMail-&gt;IsHTML(false);<\/strong><br \/>\n<strong>return $pMail-&gt;Send();<\/strong><br \/>\n<strong>$pMail-&gt;ClearAddresses();<\/strong><br \/>\n<strong>$pMail-&gt;ClearAttachments();<\/strong><br \/>\n<strong>}<\/strong><br \/>\n<strong>}<\/strong><\/div>\n<p>This needs to be done for both email.php files in order to get the user-side and backend emailing to work. There is a sample email.php available here:<\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 are on a server that does not allow the PHP mail() function or you just wish to use SMTP to send mail,<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\"> Read More ><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[31],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-oscommerce"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting up SMTP with osCommerce | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article, we will describe how to set up SMTP with OsCommerce\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting up SMTP with osCommerce | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article, we will describe how to set up SMTP with OsCommerce\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-08-26T16:37:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:53:18+00:00\" \/>\n<meta name=\"author\" content=\"Brad Markle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Markle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\"},\"author\":{\"name\":\"Brad Markle\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\"},\"headline\":\"Setting up SMTP with osCommerce\",\"datePublished\":\"2011-08-26T16:37:19+00:00\",\"dateModified\":\"2021-08-17T03:53:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\"},\"wordCount\":596,\"commentCount\":14,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"OsCommerce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\",\"name\":\"Setting up SMTP with osCommerce | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2011-08-26T16:37:19+00:00\",\"dateModified\":\"2021-08-17T03:53:18+00:00\",\"description\":\"In this article, we will describe how to set up SMTP with OsCommerce\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting up SMTP with osCommerce\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\",\"name\":\"Brad Markle\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting up SMTP with osCommerce | InMotion Hosting","description":"In this article, we will describe how to set up SMTP with OsCommerce","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/","og_locale":"en_US","og_type":"article","og_title":"Setting up SMTP with osCommerce | InMotion Hosting","og_description":"In this article, we will describe how to set up SMTP with OsCommerce","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-08-26T16:37:19+00:00","article_modified_time":"2021-08-17T03:53:18+00:00","author":"Brad Markle","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Brad Markle","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/"},"author":{"name":"Brad Markle","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf"},"headline":"Setting up SMTP with osCommerce","datePublished":"2011-08-26T16:37:19+00:00","dateModified":"2021-08-17T03:53:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/"},"wordCount":596,"commentCount":14,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["OsCommerce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/","name":"Setting up SMTP with osCommerce | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2011-08-26T16:37:19+00:00","dateModified":"2021-08-17T03:53:18+00:00","description":"In this article, we will describe how to set up SMTP with OsCommerce","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/setting-up-smtp-with-oscommerce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Setting up SMTP with osCommerce"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf","name":"Brad Markle","url":"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":31,"name":"OsCommerce","slug":"oscommerce","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/oscommerce\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":86654,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/57\/revisions\/86654"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}