khairil Posted February 12, 2006 Share Posted February 12, 2006 (edited) A simple contribution to make osCommerce works with smtp mail that requires authentication. You can find this contribution here Edited February 12, 2006 by khairil Quote Link to comment Share on other sites More sharing options...
YodasToe Posted February 13, 2006 Share Posted February 13, 2006 A simple contribution to make osCommerce works with smtp mail that requires authentication.You can find this contribution here  I installed this and fixed my problem. However now all my emails look wierd. It seems to encode the html wrong? Any ideas and help would be very much appreciated.  Regards Quote Link to comment Share on other sites More sharing options...
wedlock Posted February 14, 2006 Share Posted February 14, 2006 I have installed phpMailer4osC and works, the only problem is that email HTML does not arrive with all the attacked words seems that does not go to head when demanded as an example:  if this is the phrase sended via email:  this is problem with oscommerce   ----> to the customer it arrives:  this is problem with oscommerce    solution? Quote Link to comment Share on other sites More sharing options...
khairil Posted February 15, 2006 Author Share Posted February 15, 2006 Yeah, I figured the problem is because this contrib send email in HTML while osC send email in plain text. Â Resolution: in includes/classes/email.php and admin/includes/classes/email.php where edited in phpMailer4osC installation, replace; $pMail->IsHTML(true); with; $pMail->IsHTML(false); Â i hope this will help, cheers! :thumbsup: Â I'll update the package in contribs with new one.. thx for the feedback.! Quote Link to comment Share on other sites More sharing options...
khairil Posted February 15, 2006 Author Share Posted February 15, 2006 (edited) Yeah, I figured the problem is because this contrib send email in HTML while osC send email in plain text. Â Resolution: in includes/classes/email.php and admin/includes/classes/email.php where edited in phpMailer4osC installation, replace; $pMail->IsHTML(true); with; $pMail->IsHTML(false); Â i hope this will help, cheers! :thumbsup: Â I'll update the package in contribs with new one.. thx for the feedback.! Â this is my temporary solution if you are not using 'MIME HTML when sending email'. I will fix my contribs to fully support osC email configuration like 'E-mail linefeeds (LF/CRLF)' tomorrow.. Â sorry Edited February 15, 2006 by khairil Quote Link to comment Share on other sites More sharing options...
s_t_harvey Posted February 20, 2006 Share Posted February 20, 2006 Hi All  I have got the phpmailer contrib working fine from the customers view point but I can't get any emails to send from the admin side... i do not know what the problem is, it says that emails have been sent but they haven't... this includes the order notification emails as well.  Anybody found this problem and know what I might be doing wrong?  thanks  Simon Quote Link to comment Share on other sites More sharing options...
khairil Posted February 21, 2006 Author Share Posted February 21, 2006 Hi All I have got the phpmailer contrib working fine from the customers view point but I can't get any emails to send from the admin side... i do not know what the problem is, it says that emails have been sent but they haven't... this includes the order notification emails as well.  Anybody found this problem and know what I might be doing wrong?  thanks  Simon  just copy includes/classes/email.php to admin/includes/classes/email.php  it'll work fine.. maybe u misconfigure something in 'admin/includes/classes/email.php' Quote Link to comment Share on other sites More sharing options...
youngan Posted February 24, 2006 Share Posted February 24, 2006 I installed this and fixed my problem. However now all my emails look wierd. It seems to encode the html wrong? Any ideas and help would be very much appreciated. Regards  Did you ever find out this problem? I'm having the same issue. The email that is sent is all funky.   Quote Link to comment Share on other sites More sharing options...
dave4050 Posted March 1, 2006 Share Posted March 1, 2006 Hey great contrib. I was having serious problems getting emails out until this fixed it. Have you come up witha solution for the funny looking html problem? I have it set to text for now, but I would like to send out MIME Html soon. Quote Link to comment Share on other sites More sharing options...
Terje Posted March 6, 2006 Share Posted March 6, 2006 I have got the phpmailer contrib working fine from the customers view point but I can't get any emails to send from the admin side... i do not know what the problem is, it says that emails have been sent but they haven't... this includes the order notification emails as well. Â I have the same problem, everything is OK from catalog-side - but from admin-side there seems to be an error in in adressing. Â This is from the smtp-server: Â warning: Illegal address syntax from unknown[10.0.1.15] in MAIL command: Â Any idea why this is happening? Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 Hi, this email thing is driving me nuts! I started having email problems with three osCommerce sites just recently (found out yesterday) and after hours of trying, this contribution seems to be the only solution. My sites are hosted on a Win32 server and I guess it gets changed fairly often as I often feel the sharp end of changes that are made. Due to this I thought I would try this mod instead of submitting a helpdesk ticket to my hosts.  After installing it, I found that the emails work for admin and customer...unless it's a hotmail account?! I have tried various tests with my hotmail and isp account (v21.co.uk) and the emails failed every time for the hotmail.  I then started to test it with various email accounts for my domain name (I have a catch all account so set up accounts with emails such as [email protected], [email protected]). The newsletter, admin email, order update, customer email, product notification..all work for the non hotmail accounts but fail for the hotmail. For the hotmail account I get an returned email to the store admin address like this:  We're sorry. There's a problem with the e-mail address(es) you're trying to send to. Please verify the address(es) and try again. If you continue to have problems, please contact Customer Support at (480) 624-2500.  <[email protected]>: Connected to 65.54.245.40 but sender was rejected. Remote host said: 501 Invalid Address  --- Below this line is a copy of the message.  Return-Path: <"SRS0=zW1u=46=uploadyourbusiness.com=TESTSITE <admin"@bounce.secureserver.net> Received: (qmail 14230 invoked by uid 1000); 7 Mar 2006 23:51:29 -0000 Delivered-To: [email protected] Received: (qmail 14223 invoked from network); 7 Mar 2006 23:51:29 -0000 Received: from pre-smtp13-02.prod.secureserver.net (HELO pre-smtp13-02.prod.mesa1.secureserver.net) ([64.202.166.17]) (envelope-sender <[email protected]>) by smtp03-01.prod.mesa1.secureserver.net (qmail-ldap-1.03) with SMTP for <[email protected]>; 7 Mar 2006 23:51:29 -0000 Received: (qmail 9401 invoked from network); 7 Mar 2006 23:51:29 -0000 Received: from unknown (HELO www.uploadyourbusiness.com) ([209.132.213.40]) (envelope-sender <[email protected]>) by pre-smtp13-02.prod.mesa1.secureserver.net (qmail-ldap-1.03) with SMTP for <[email protected]>; 7 Mar 2006 23:51:28 -0000 Date: Tue, 7 Mar 2006 15:53:04 -0800 Return-Path: TESTSITE <[email protected]> To: marcus wilding II <[email protected]> From: TESTSITE <[email protected]> Subject: test newsletter Message-ID: <[email protected]> X-Priority: 3 X-Mailer: PHPMailer [version 1.73] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1"  When selecting my SMTP settings for email.php I have entered:  $pMail->Host = "smtp.secureserver.net"; $pMail->Username = ""; $pMail->Password = ""; $pMail->SMTPAuth = false;  Does this mean that smtp.secureserver.net may be blocking hotmail email or something? Any help would be appreciated.  Cheers Marcus  ps:- Thanks for the contribution khairil Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 :blush: Okay, forget that last message, I was wrong about the ISP email, the account I set up with my v21.co.uk was also failing. I think I see what I'm doing wrong. Â I have the domain www.uploadyourbusiness.com (test site) hosted at webhost4life and they gave an SMTP address for the mail for this domain 'smtp.secureserver.net'. I guess only domains setup for this address can get mails through it and this is where I am going wrong. Â As I set up my SMTP with the details from my domain registrar it is letting all email with my domain name pass though, all other email gets blocked. Â I guess my question is, what SMTP server do I use? Â Cheers, Marcus. Â :blink: Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 Ok, I just asked my hosts 'What SMTP server do I use for php? ' Â They replied 'You do NOT need to use any. All servers are setup to send email in the php.ini. You do not need to make any changes to it. ' Â Does this mean that the PHP.INI is incorrect? Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 8, 2006 Share Posted March 8, 2006 Right. Your best bet is to check your php settings and make sure SMTP reads as localhost or 127.0.0.1 You sendmail should be from ie. [email protected]  As far as the mail is concerned .. I believe you were misinformed by your service provider. Your email class needs to know your Host .. Username ... and Password, or else anyone could use anyones Host to send mail to anyone. Your Host has to verify that you are who you say you are in order to gain access to the mail server.   You should also check in both the catalog side and admin side .. the directory includes/classes/email.php  Where you see something similar to this: You need to find out from your Host what their SMTP address is. For example I am with bellnet ... one of their most common open channel for smtp is ... smtp10.bellnet  $pMail->IsSMTP(); $pMail->Host = "smtp10.bellnet.ca"; // replace with your smtp server // ie mail.yourdomain.com $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "mypasswordhere"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication  Hope this gets you on the right track. Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 Thanks for the info insomniac2, do you mean the PHP on web host4lifes server? I ran a quick script on the server of webhost4life which returned the following info for the php settings on the server my sites are running on. Does it look correct?  safe_mode Off sendmail_from [email protected] sendmail_path no value serialize_precision 100 short_open_tag On SMTP 209.132.213.40  Also, when you say my sendmail settings, do you mean in the stores Admin --> Configuration -->My Store Setting?  The confusing thing for me is my domain name is registered with godaddy.com - www.mydomain.com  The email account is registered with them - [email protected]  But my site is actually hosted with webhost4life  who do I get the SMTP host, username and password from? The company who hosts my site or I have my email with?.....I guesss I should look at moving it all together.. Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 8, 2006 Share Posted March 8, 2006 OK I assume from what your saying is that you have an email account registered with godaddy.com ... You say it is [email protected]  so if this is true what you would do is ...  1. yes check your admin configuration setting ... make sure it is set to use SMTP  2. since you are not hosting your own server .. don't worry about php.ini stuff .. it does not apply to you.  3. i assume you are using phpMailer4osC - smtp with authentication from your posts here. I am using it and it works great.  4. Now there are 2 files you have to set up with this package. Go to catalog/includes/classes/email.php ... and catalog/admin/includes/classes/email.php  Assuming you installed the mod correctly and as in the instructions reconfigured the code in class.smtp.php files  Now in each email.php file find the section I mentioned in the previous post which looks like this and put your info there. This is where your problem is.  $pMail->IsSMTP(); $pMail->Host = "[email protected]"; // replace with your smtp server // ie mail.yourdomain.com $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "mypasswordhere"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication   Notice the three variable you have to put you info in:  yourdomain.com is the domain name you registered with godaddy.com ... put it where the words yourdomain.com are.  mydomain.com is your email account name registered with godaddy.com ... so put your username in where the words mydomain.com are.  mypasswordhere is your email account password for your godaddy.com email account .. so put your password in where the words mypasswordhere are.  I know it is confusing at first ... but once you get it .. u will see the big picture. And if we knew your real domain name it would be a lot less writing and confusion. Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 8, 2006 Share Posted March 8, 2006 oops sorry ... I meant to say for the second variable: Â mydomain.com is your email account name registered with godaddy.com ... so put your username in where the words admin are ... and the your registered domain name where the words mydomain.com are Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 Thanks for the help insomniac2, that?s almost the setup I had originally when I was getting all emails failing except for ones setup for the domain. My settings are now as below:  my domain - www.uploadyourbusiness.com  $pMail->Host = "smtpout.secureserver.net"; $pMail->Username = "[email protected]"; $pMail->Password = "*******"; $pMail->SMTPAuth = true;  The smtpout.secureserver.net part is what godaddy told me to set to get the account working with Outlook. Putting 'uploadyourbusiness.com' here doesn't allow any email functionality to work.  Using the settings shown above, the contact us page works fine. I then setup three test users with the following email accounts:  Customer 1 - [email protected] Customer 2 - [email protected] Customer 3 - [email protected]  I ran a few tests and found the following: All three of these customer accounts can request password emails fine. All three accounts can use the notify a friend to send product info The store owner/admin can only send newsletters AND emails to Customer 2, who has the [email protected] email account. The other two Customers get 'Remote host said: 501 unacceptable mail address' When ANY of the customers makes a purchase, only the customer gets the confirmation email, none is sent to the store admin. When ANY customers order status is changed by the store owner/admin, they ALL receive email notification. One thing I did notice in your post is that you mention 'reconfigured the code in class.smtp.php', do I need to modify these files? The readme doesn't mention it?   Just one more thing that I may be misunderstanding here are some settings in the actual site hosting control panel for the domain. Like I mentioned earlier, godaddy.com are the registrars of my domain www.uploadyourbusiness.com and that's also where I created the email account. However, that domain name is forwarded to my site which is hosted at webhost4life.com. Now, webhost4life have a DNS section in the web control panel which allows me to set DNS records for www.uploadyourbusiness.com as shown below:   Now my eyes are bleeding... :o can you help....please.. Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 8, 2006 Share Posted March 8, 2006 Well from what you say and have done .. everything should work in my mind. Â I guess your best bet would be to ugrade the oscommerce smtp class. I mentioned it and am sorry. Yes it is not a mod from the osc community. Â It upgrades your smtp class from v1.02 to 1.05 Â I would try it .. what have you got to lose. Â Heres the instructions .. as I do not remember where I got them from. Then you will have to download the files from the site below and and make a small modification to your email.php files to point them to the new class.smtp.inc files. Don't forget to put your settings from your post in the class.smtp.inc files. Â heres the link for class.smtp.inc v1.05 Â http://www.phpguru.org/downloads/smtp/ Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 8, 2006 Share Posted March 8, 2006 Thanks for that, I'll give it a try now on my test site. Â Just one question regarding the part in you rpost Heres the instructions .. as I do not remember where I got them from. Then you will have to download the files from the site below and and make a small modification to your email.php files to point them to the new class.smtp.inc files. Don't forget to put your settings from your post in the class.smtp.inc files. Â Is that all the instructions once I download the files? Â Thanks again, Â Marcus. Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 8, 2006 Share Posted March 8, 2006 Oh .. Sorry .. Stupid Me LOL!  Heres the install instructions:  Original Author: chen binghua Modified By: Ray Knapp  XXXXXX-----XXXXX Open and edit the class.smtp.inc  EDIT THE HOST, USERNAME, PASSWORD.  Upload the class.smtp.inc to catalog/includes/classes/ AND /admin/includes/classes/  XXXXXX-----XXXXX  Open and edit the email.php file in both catalog/includes/classes/ and /admin/includes/classes/  "EDIT THE HOST, HELO, USERNAME, PASSWORD."  FIND THE FOLLOWING LINE:  if (EMAIL_TRANSPORT == 'smtp') {  JUST BELOW IT REPLACE:  return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));  WITH THE FOLLOWING:  // begin smtp authentication  include(DIR_WS_INCLUDES . '/classes/class.smtp.inc'); // use this: include_once(DIR_WS_INCLUDES . '/classes/class.smtp.inc'); if get Cannot Redeclare Class SMTP Error // The smtp server host/ip $params['host'] = 'localhost'; // The smtp server port $params['port'] = 25; // What to use when sending the helo command. Typically, your domain/hostname $params['helo'] = 'terracomp.ca'; // Whether to use basic authentication or not $params['auth'] = TRUE; // Username for authentication $params['user'] = '[email protected]'; // Password for authentication $params['pass'] = 'minty29minty34'; // The recipients (can be multiple) $send_params['recipients'] = array("$to_addr");  $send_params['headers'] = array("From: $from", "To: $to_addr", "Subject: $subject"); // This is used as in the MAIL FROM: cmd // It should end up as the Return-Path: header $send_params['from'] = ''; // The body of the email $send_params['body'] = "$this->output";  is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params);  // end smtp authentication  XXXXX-----XXXXX WILL NOT WORK WITH EXTRA ORDER EMAILS Go to admin Select configuration / Send extra order emails to: Make sure it is blank  ________________________________________________________________________________ ________________________________  // Fix For SMTP Errors   The parts that were sending the junk info were:  CODE $send_params['headers'] = array("From: your email address ", "To: $to_addr", "Subject: $subject"); and CODE $send_params['from'] = 'your email address';   For the headers section I changed : CODE From: your email address ", to CODE "From: Egregore Publishing <[email protected]>", and changed : CODE $send_params['from'] = 'your email address'; to: CODE $send_params['from'] = '[email protected]';   Now e-mails are sent to me. To fix the problem of me sending e-mails to my customers, I installed the contribution in the admin section the same way that I did in the catalog area, and applied the fixes that I noted above. Everything works just fine.  I hope this helps others that have had the same problems that I had. Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 9, 2006 Share Posted March 9, 2006 Thanks, for that :) I'm trying it now... Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 9, 2006 Share Posted March 9, 2006 Sorry about that time delay, I'm testing it between bouts of illness due to food poisoning I've had this week :blink: Â I installed it and it looked like it was all working then the hotmail customer account started playing up. Is the osC email normally stable? It seems to be okay sometimes, but not all the time?! Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted March 9, 2006 Share Posted March 9, 2006 Were you able to get things sorted out? I have not had any problems with email other than when I go mucking around adding tons of mods and code .. but usually get it figured out. Right now though my create account file is so congested with code I have lost my email notification for new accounts ... I am trying to figure out where the problem is. But all in all things seem pretty stable. Â I have to say I have not tried email to any of the free email account hosts like hotmail ... but I can say even with other software such as outlook express I used to be able to set up to retrieve hotmail. Now they have purposely made it impossible because they keep changing their login scripts all the time. So I just ditched them. I use yahoo mail and they are always consistent. Â Oh and in the post above I never did the bottom part where he changed the email headers etc. I just did the top code for the smtp upgrade. I just found that last piece below the black separation line in a forum or something. Quote Link to comment Share on other sites More sharing options...
mwildin1 Posted March 10, 2006 Share Posted March 10, 2006 Hi insomniac2, I copied the class files and modified the email.php files as per your instructions and it all seems to be working fine now, thanks! Â New user email - OK New Order Email to customer & Admin - OK Password reminder Email - OK Admin to Customer Email - OK Newsletter Email - OK Order Update to Customer Email - OK Â Not too sure on the product notification yet as I need to read up on how that actually works anyway. Â I also added a mod mentioned here http://www.oscommerce.com/forums/index.php?showtopic=131666&hl= Â It mentions that this -f attribute could also prevent emails getting sent from the osC application being stopped by spam filters on SMTP servers due to the mails not contain a valid email sender address. Not sure if it's needed in my case but I installed it anyway and the emails still come through fine. Â Another mod I found but did not use was for ISP's blocking emails, but will see how my current setup goes before using it http://www.oscommerce.com/forums/index.php?sho...94entry702994 Â Thanks for you help with this, I appreciate it! Â Marcus :thumbsup: Â ps:- Who hosts your site? I have been looking into dedicated server V's Co-Location hosting rather than using my current shared setup. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.