Guest Posted March 27, 2006 Share Posted March 27, 2006 Hi, I set up developer/test server on my windows computer and sent some time trying to figure out how to send emails from php to ISP's smtp server with authentication with no much luck. Then I found and installed this contribution, seemed like it should to the job. Now I got these error messages: Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\Program Files\Apache Group\Apache2\htdocs\site\admin\includes\classes\class.smtp.php on line 105 Warning: fsockopen() [function.fsockopen]: unable to connect to outgoing.verizon.net:25 (Unknown error) in C:\Program Files\Apache Group\Apache2\htdocs\site\admin\includes\classes\class.smtp.php on line 105 I've no idea how to fix it. Anybody, HELP! :unsure: Quote Link to comment Share on other sites More sharing options...
mJULESY Posted April 16, 2006 Share Posted April 16, 2006 Hi there, i have just finished installing this and giving it a little testing, but am having a little trouble. When i send any emails, the emails come in with junk at the start and at the end, For example at the begining of every email is: --=_2aa1325be4f6569bfd837e7bba228893Content-Type: text/plain; charset="iso-8859-1"Content-Transfer-Encoding: 7bit and then at the end of every email, the email is repeated but with no CRLF incerted. and the following junk text: --=_2aa1325be4f6569bfd837e7bba228893Content-Type: text/html; charset="iso-8859-1"Content-Transfer-Encoding: quoted-printable Now if i turn off the oscommerce setting "Use MIME HTML When Sending Emails" to false then the problem goes away, but then "CRLF" are not incerted into the email, so the email is all grouped together. does anyone know what the problem is with MIME HTML? insomanic2 did say this: ------------------------------------------------------------------------- // 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]'; ------------------------------------------------------------------------------------ which i have done, but made no difference? Was this supposed to fix this problem? Also he did say in an earlier post that he would fix the CRFL problem, does anyone know if this happened? many thanks in advance, Mark Quote Link to comment Share on other sites More sharing options...
Guest Posted June 15, 2006 Share Posted June 15, 2006 I know this is a crude 'hack' to get things working but here it is: includes/email.php change the following: $pMail->Body = $this->output; TO: $temp = split("--=",$this->output); $bodytemp = split ("7bit",$temp[1]); $pMail->Body = $bodytemp[1]; admin/includes/email.php change the following: $pMail->Body = $this->output; TO: $pMail->Body = ereg_replace("\r\n","<BR>",$this->output); Although not perfect as emails have 'extra' lines in these alterations are allowing me to send HTML emails for orders, passwords, and newsletters. Hopefully someone else might be able to come up with a better fix. Quote Link to comment Share on other sites More sharing options...
xnitex Posted June 19, 2006 Share Posted June 19, 2006 (edited) for those who is getting From: test <root@localhost> as return address hardcode your email as below includes/classes/email.php and admin/includes/classes/email.php require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; change $pMail->From = $from_addr; to $pMail->From = "[email protected]"; Edited June 19, 2006 by xnitex Quote Link to comment Share on other sites More sharing options...
Duanium Posted July 30, 2006 Share Posted July 30, 2006 In order to use this contribution with osCommerce and NOT hardcode the "text" flag as false or true, I modified the following line in email.php: From $pMail->IsHTML(false); to (EMAIL_USE_HTML == false || EMAIL_USE_HTML == 'false') ? $pMail->IsHTML(false) : $pMail->IsHTML(true); Works fine for me. I had to use the OR because false (with no single quotes) wasn't working for me. I thought I'd be sure and cover all the bases. Be sure to change both the email.php in the category/includes/classes and admin/includes/classes. Quote Link to comment Share on other sites More sharing options...
channela Posted August 1, 2006 Share Posted August 1, 2006 A simple contribution to make osCommerce works with smtp mail that requires authentication.You can find this contribution here Hi all.. I need to where I can download this phpmailer4osc ? . I follow the above link but cannot find one. pls help.... Quote Link to comment Share on other sites More sharing options...
Duanium Posted August 3, 2006 Share Posted August 3, 2006 Hey Channela, Here's the direct link: http://www.oscommerce.com/community/contributions,4013/download,12157 For future reference, just click on the icon that looks like this Quote Link to comment Share on other sites More sharing options...
inbox Posted August 7, 2006 Share Posted August 7, 2006 hi i wonder if this contrib. works with linux as well ? my server runs cpanel w/ linux and apache Quote Link to comment Share on other sites More sharing options...
CGhoST Posted August 14, 2006 Share Posted August 14, 2006 Is there some way of getting emails to send in HTML format properly. I also have sendmail for windows installed. It comes with xampp. If i want to use sendmail how do i configure to use that option please? Quote Link to comment Share on other sites More sharing options...
khairil Posted August 15, 2006 Author Share Posted August 15, 2006 sorry guys! i've been busy with my job. for those of you have any modification to my code can always uplode the modded version of phpMailer4osc to contribution page at http://www.oscommerce.com/community/contri...h,phpmailer4osc and also please describe what have been modded. i'm not planning to update this contribution anymore since the next new version osCommerce will support smtp as well. thanx a lot! Quote Link to comment Share on other sites More sharing options...
rasgirl Posted August 27, 2006 Share Posted August 27, 2006 sorry guys! i've been busy with my job. for those of you have any modification to my code can always uplode the modded version of phpMailer4osc to contribution page at http://www.oscommerce.com/community/contri...h,phpmailer4osc and also please describe what have been modded. i'm not planning to update this contribution anymore since the next new version osCommerce will support smtp as well. thanx a lot! Ok I think Im going to cry Ive been working on this problem for a month..I was so exited to find this cont. I installed it changed it and still no emails whats wrong here.. if (EMAIL_TRANSPORT == 'smtp') { 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)); //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)); require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "mail.genesisav.com"; // replace with your smtp server $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "XXXXXXX"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication Quote Link to comment Share on other sites More sharing options...
rasgirl Posted August 27, 2006 Share Posted August 27, 2006 Ok I think Im going to cry Ive been working on this problem for a month..I was so exited to find this cont. I installed it changed it and still no emails whats wrong here.. if (EMAIL_TRANSPORT == 'smtp') { 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)); //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)); require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "mail.genesisav.com"; // replace with your smtp server $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "XXXXXXX"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication OK I have tried ..(smtp.mail.ipower.com) (mail.ipower.com) (smtp.mail.genesisav.com)basically I tried everything I could and still can't get it to work...the files are in the right places what am I doing wrong Quote Link to comment Share on other sites More sharing options...
Hutchmeister Posted October 23, 2006 Share Posted October 23, 2006 Did anyone get this contrib working properly with HTML mail? (or even with txt reliably?) I'm about to remove it and try and write my own version, but would really rather not as It'll take me ages to learn whats needed. I have an OSC install 99% ready to go live, and authenticated outbound email is the last hurdle! Set-up: Local mailserver, PHP 5.*, Windows 2003 Web Edition (dedicated, not shared) Thanks, Ben Quote Link to comment Share on other sites More sharing options...
dizn0g Posted December 19, 2006 Share Posted December 19, 2006 Using the information in this thread I have also been unable to get HTML emails working, and text is also a little screwy... Anybody have some good solutions to this? dizn0g Quote Link to comment Share on other sites More sharing options...
BlueSnakeMedia Posted January 5, 2007 Share Posted January 5, 2007 Hi I have been scratching my head trying to get these html emails to send properly without all the encoding junk showing up in the email for a couple of days. Have tried everything on these post but nothing worked for me. The only explanation i could see was that the email appeared to be getting encoded more than once using the phpmailer addon as described above so that the coding was showing up in the email ?? i have got it to work by changing the tep_email function in /functions/general.php for both the catalog and admin sections, commenting out what was there and adding in the basic phpmailer code so that only the phpmailer does the encoding and not oscommerce original code. Now it works fine for sending html (have not tested sending text based emails) as long as you have the class.phpmailer.php and class.smtp.php in your include/classes folder (dont forget admin/includes/classes aswell), and dont forget to setup your details in the code below. Use at your own risk ! :) Anyone got time to work this into OsCommerce properly?? function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { if (SEND_EMAILS != 'true') return false; // Instantiate a new mail object //$message = new email(array('X-Mailer: osCommerce Mailer')); // Build the text version //$text = strip_tags($email_text); //if (EMAIL_USE_HTML == 'true') { // $message->add_html($email_text, $text); //} else { // $message->add_text($text); //} // Send message //$message->build_message(); //$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); //BOF PHPMAILER require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_email_address; $pMail->FromName = $from_email_name; $pMail->IsSMTP(); $pMail->Host = "yoursmtp.server.co.uk"; // replace with your smtp server $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "yourpassword"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $email_subject; $pMail->Body = $email_text; $pMail->AltBody = $email_text; $pMail->AddAddress($to_email_address, $to_name); $pMail->AddReplyTo("[email protected]", "sales"); $pMail->WordWrap = 50; $pMail->IsHTML(true); $pMail->Encoding = '7bit'; $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); // EOF PHPMAILER } Quote Link to comment Share on other sites More sharing options...
luxewijnen Posted February 14, 2007 Share Posted February 14, 2007 (edited) I do not seem to get the phpMailer4osC to work and I do not know what I do wrong... (I use osCommerce 2.2-MS2) 2 questions, i hope you can help me out: - Do I also need to edit (or enter my host, username and password) in the class.phpmailer.php and class.smtp.php? - For host I use my mail server, so i enter a certain IP adres with the points in it. Is this coorect and is it possible to use an IP adress as a Host within phpMailer4osC? Hope you can help me guys, these email problems are driving me crazy :-( Edited February 14, 2007 by luxewijnen Quote Link to comment Share on other sites More sharing options...
jayeshshiyani Posted March 8, 2007 Share Posted March 8, 2007 I have just tried to implement this phpMailer4osC but still not working.... i made sure to made to chage in email.php as you can see below: //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)); require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "mail.acefashionsltd.com"; // replace with your smtp server $pMail->Username = "******"; // replace with your smtp username (if SMTPAuth is true) $pMail->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(true); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); // begin smtp authentication include_once(DIR_WS_CLASSES . 'class.smtp.php'); // The smtp server host/ip $params['host'] = EMAIL_SMTP_HOST_SERVER; // The smtp server port $params['port'] = EMAIL_SMTP_PORT_SERVER; // What to use when sending the helo command. Typically, your domain/hostname $params['helo'] = EMAIL_SMTP_HELO_SERVER; // Whether to use basic authentication or not $params['auth'] = EMAIL_SMTP_ACTIVE_PASSWORD; // Username for authentication $params['user'] = EMAIL_SMTP_USERNAME; // Password for authentication $params['pass'] = EMAIL_SMTP_PASSWORD; // The recipients (can be multiple) $send_params['recipients'] = array("$to_addr"); $send_params['headers'] = array("From: " . EMAIL_SMTP_NAME , "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'] = EMAIL_SMTP_NAME; // The body of the email $send_params['body'] = "$this->output"; is_object($smtp = smtp::connect($params)) AND $smtp->send($send_params); // end smtp authentication } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } } do i need to change anything in the two class files provided? please help im totally stuck! and its really doing my head!! Quote Link to comment Share on other sites More sharing options...
Guest Posted April 8, 2007 Share Posted April 8, 2007 what are the benefits to using this contribution? is smtp authentication a basic requirement to most mailservers (in order to send mail to them)? will this stop the from: "unknown" line in the headers? Quote Link to comment Share on other sites More sharing options...
adf Posted July 11, 2007 Share Posted July 11, 2007 I have set up it step by step, but when I test it to send mail the error message is show as 'Fatal error: Maximum execution time of 30 seconds exceeded in c:\appserv\www\just\admin\includes\classes\class.smtp.php on line 1024'. I am using the gamil and I don't know the port (465) of SMTP server is the problem or not. Quote Link to comment Share on other sites More sharing options...
offordscott Posted July 19, 2007 Share Posted July 19, 2007 I was receiving this at the top of each email I recieve: --=_d39094daca299812e7f5faefe9645400 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit And this at the bottom: --=_2eb3bc0d505deb33e905e45d6a50ecf0-- Also, the emails I was receiving repeated the content twice. The first occurance was formatted well, then the second occurance was the same content, but with <br> tags and = signs. The only way I could get this working was with these settings in the admin: Transport Method smtp Linefeeds LF (if I use CRLF there the email is double spaced, not as nice) Use MIME HTML false And this setting in both email.php files: $pMail->IsHTML(false); Scott Quote Link to comment Share on other sites More sharing options...
bpmcclure Posted January 14, 2008 Share Posted January 14, 2008 I have installed phpMailer4osC_v1, and after some help from my ISP I got the emails working, except for the feature of sending extra order emails to more than one address. But the email text format is a jumble. I have switched linefeeds set to CRLF and MIME HTML to False, which gives the least garbage in the email, but my emails do not seem to be picking up the line breaks in the code. Here is an example: Suppertime Express ------------------------------------------------------ Order Number: 26 Detailed Invoice: https://www.suppertimexpress.com/os/account...php/order_id/26 Date Ordered: Monday 14 January, 2008 Products ------------------------------------------------------ 1 x Honeyed Pork Chops for 2 () = $9.20 ------------------------------------------------------ Sub-Total: $9.20 Sales Tax: $0.69 Total: $9.89 Delivery Address ------------------------------------------------------ Bruce McClure 5215 pacifica Drive San Diego, 92109 United States Billing Address ------------------------------------------------------ Bruce McClure 5215 pacifica Drive San Diego, 92109 United States Payment Method ------------------------------------------------------ Pay on Pick Up or Delivery This looks better than it does in the Outlook email! The ----- on the left margin here are run together pretty randomly (I can provide a screenshot if needed). I saw some discussion of this in this thread, and am hoping someone has solved it already and can point me to the right post. Thanks! Bruce Quote Link to comment Share on other sites More sharing options...
bpmcclure Posted January 15, 2008 Share Posted January 15, 2008 Hi I have been scratching my head trying to get these html emails to send properly without all the encoding junk showing up in the email for a couple of days. Have tried everything on these post but nothing worked for me. The only explanation i could see was that the email appeared to be getting encoded more than once using the phpmailer addon as described above so that the coding was showing up in the email ?? i have got it to work by changing the tep_email function in /functions/general.php for both the catalog and admin sections, commenting out what was there and adding in the basic phpmailer code so that only the phpmailer does the encoding and not oscommerce original code. Now it works fine for sending html (have not tested sending text based emails) as long as you have the class.phpmailer.php and class.smtp.php in your include/classes folder (dont forget admin/includes/classes aswell), and dont forget to setup your details in the code below. Use at your own risk ! :) Anyone got time to work this into OsCommerce properly?? function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { if (SEND_EMAILS != 'true') return false; // Instantiate a new mail object //$message = new email(array('X-Mailer: osCommerce Mailer')); // Build the text version //$text = strip_tags($email_text); //if (EMAIL_USE_HTML == 'true') { // $message->add_html($email_text, $text); //} else { // $message->add_text($text); //} // Send message //$message->build_message(); //$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject); //BOF PHPMAILER require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_email_address; $pMail->FromName = $from_email_name; $pMail->IsSMTP(); $pMail->Host = "yoursmtp.server.co.uk"; // replace with your smtp server $pMail->Username = "[email protected]"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "yourpassword"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $email_subject; $pMail->Body = $email_text; $pMail->AltBody = $email_text; $pMail->AddAddress($to_email_address, $to_name); $pMail->AddReplyTo("[email protected]", "sales"); $pMail->WordWrap = 50; $pMail->IsHTML(true); $pMail->Encoding = '7bit'; $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); // EOF PHPMAILER } Hi, Did this solution solve the problem of all the junk in emails sent out? I'll give it a try and see if I can make it work too; I'm ready to try anything at this point! Bruce Quote Link to comment Share on other sites More sharing options...
bpmcclure Posted January 16, 2008 Share Posted January 16, 2008 Hi, Did this solution solve the problem of all the junk in emails sent out? I'll give it a try and see if I can make it work too; I'm ready to try anything at this point! Bruce Tried it and no luck. Still get the junk in the emails. Anyone solved this one? Quote Link to comment Share on other sites More sharing options...
designerowen Posted August 6, 2008 Share Posted August 6, 2008 Thanks for help me Quote Link to comment Share on other sites More sharing options...
delucca Posted October 27, 2008 Share Posted October 27, 2008 Hi all.... I am having trouble sending emails from the 'Admin' side of osCommerce... basically, using PHPmailer4oc, and following the instructions, the only email that reaches its destination is the new registration 'thank you' email. In the 'Admin' side of things, when i send an email to a customer, I get a confirmation message at the top of my screen saying 'Notice: email has been sent to: (email in here)', but the email never arrives at the customers inbox. I have noticed others on these forums have had this problem, but no solution has been listed. Any help would be GREATLY appreciated as this is the last 'fix' i need to do before the site is live. Thanks in advance... 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.