pstrid Posted January 3, 2006 Share Posted January 3, 2006 Just switched hosting companies and now have to use SMTP to send emails (previously using sendmail without a problem) Has anyone figure out how to get the send_order_html_email contribution working with SMTP (ie PEAR Mail::Factory)? I have been able to make the changes to the includes/classes/email.php file so I can send emails using Mail:Factory but can only send in non-html format. I am unable to figure out how to get MIME HTML emails to be sent that are generated using the send_order_html_email contribution. Help please :( Quote Link to comment Share on other sites More sharing options...
pstrid Posted January 4, 2006 Author Share Posted January 4, 2006 So, here's the code I using in my mail.php file. if (EMAIL_TRANSPORT == 'smtp') { include_once("Mail.php"); $user_contact = [email protected]'; $headers["From"] = $from; $headers["To"] = $to_addr; $headers["Subject"] = $subject; $headers["Bcc"] = ""; $params["host"] = "scriptmail.xxx.net"; $params["port"] = "25"; $params["auth"] = false; $params["username"] = ""; $params["password"] = ""; // Create the mail object using the Mail::factory method $mail_object =& Mail::factory("smtp", $params); return $mail_object->send("$to_addr, [email protected]", $headers, $this->output); A plain text email is delivered fine when I have Use MIME HTML When Sending Emails set to false. When set to true, the emails are still delivered but the HTML code comes through and is never rendered as HTML code. For Example, part of one of the emails would look like this: --=_8f5de596bb60d92285923b8a86493f06 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Store Name ? Dear John Doe: ? Your order is: In Process* ? N?mero de Pedido: Fecha del Pedido: Tuesday 03 January, 2006To view your order:http://www.storename.com/live/account_history_info.php?order_id=1043 Other Comments: <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset= =3Diso-8859-1"> <base href=3D"http://www.storename.com/live/"> <lin= k rel=3D"stylesheet" type=3D"text/css" href=3D"stylesheetmail.css"> </head>= <body><div align=3D"center"> <table width=3D"600" border=3D"0" cellpadding= =3D"2" cellspacing=3D"0" > <tr> <td><table border=3D"0" width=3D"100%" ce= llspacing=3D"0" cellpadding=3D"2" > <tr> <td class=3D"page= Heading" valign=3D"bottom" align=3D"center"> Thinking i may have to add some include like include('Mail/mime.php'); Help is needed greatly:( Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted January 4, 2006 Share Posted January 4, 2006 Hi, Just wanted to say that I've got the same trouble with source code format but I'm not using the SMTP. I use SendMail and I still have exactly the same symptoms. The graphical result is correct but the source is just not. I'll keep looking and let you know if I find anything. Xiao Quote Link to comment Share on other sites More sharing options...
pstrid Posted January 4, 2006 Author Share Posted January 4, 2006 I have been reading http://pear.php.net/manual/en/package.mail.php to try and figure out an answer but still no luck. Please let me know if you come across anything. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2006 Share Posted August 23, 2006 did this ever get solved? Quote Link to comment Share on other sites More sharing options...
Luchysoft Posted May 17, 2007 Share Posted May 17, 2007 DID this ever get solved? I am trying to use the Pear html contrib, but as stated in the contrib, the mime/html is not working. That is true. I was able to send mime emails using sendmail, but I have switched to using Pear for email so I can use SMTP, but the html comes through all garbled. I have also tried using the Pear Mail_mime, but that is not working (or I am not doing something right). Quote Link to comment Share on other sites More sharing options...
tenthsynth Posted April 3, 2014 Share Posted April 3, 2014 I was faced with this exact problem when enabling the HTML MIME option via the admin control panel also (osc 2.3.3). I was able to fix it by modifying the tep_mail() function in general.php .. here is my version, it works: 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')); // 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(); $to = $to_email_address; $subject = $email_subject; $headers = "From: " . $from_email_address . "\r\n"; $headers .= "Reply-To: ". $from_email_address . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to_email_address,$email_subject,$email_text,$headers); } Basically something funky with the $message->send line, now instead I am just using the regular mail() function. Regards, Jason Quote Link to comment Share on other sites More sharing options...
MarcelM013 Posted June 14, 2017 Share Posted June 14, 2017 Does someone fix this problem? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 19, 2017 Share Posted June 19, 2017 I have the same problem :-( Quote Link to comment Share on other sites More sharing options...
shore Posted September 10, 2018 Share Posted September 10, 2018 On 8/24/2006 at 12:29 AM, rojabuck said: did this ever get solved? Quote Link to comment Share on other sites More sharing options...
a123 Posted September 11, 2018 Share Posted September 11, 2018 @shore Probably you can find here the solution:https://github.com/haraldpdl/oscommerce2/commit/446237d9123a30ed706782924c716b0724cd77a1 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.