Steps to reproduce issue:
1. Log into Admin panel
2. Go to Customers > Order
3. Select any order
4. Change "Status" field, select "Notify Customer", enter anything into "Comments"
5. Update order
The issue: the customer does not receive any notification / email.
1. Log into Admin panel
2. Go to Customers > Order
3. Select any order
4. Change "Status" field, select "Notify Customer", enter anything into "Comments"
5. Update order
The issue: the customer does not receive any notification / email.
All other email notifications work perfectly- what could make this one script function incorrectly?Qphoria wrote:This is particular to people's servers.. not a blanket bug. It works fine for most people. It is just those who have issues with the mail class right now. There are other posts about that.
I don't think this is the case.. unless it has its own mail class.
Would someone be so kind as to test this feature on their own system and let me know if it works???
From what i can gather... it comes down to content of the email.. I'm not sure which bit, but typically in these situations, the contact form works as it is simple text... perhaps the order email has some line breaks or characters that cause it to choke for some. It has been an ongoing research issue, but already there have been many class rewrites in the past few versions.
Still, many of us do not see any problems. So it is still one of the big mysteries of life.
Still, many of us do not see any problems. So it is still one of the big mysteries of life.
Hey, Q... I was wondering:Qphoria wrote:From what i can gather... it comes down to content of the email.. I'm not sure which bit, but typically in these situations, the contact form works as it is simple text... perhaps the order email has some line breaks or characters that cause it to choke for some. It has been an ongoing research issue, but already there have been many class rewrites in the past few versions.
Still, many of us do not see any problems. So it is still one of the big mysteries of life.
I bought a module (RSS Google Base Feed) from your website. Could you test this on my order, in your admin panel?? It should only take a couple minutes, and it'd confirm or debunk this issue, entirely (if it works, the error is not with OC.. if it doesn't work, we've found a bug).
I really appreciate your help... you're the man!
I just updated and order on www.countryfreezers.com using GoDaddy as a host and the email worked fine.
I just checked and I do not have any emails from you in my inbox.Qphoria wrote:Ok i just sent an update to you yesterdaynpws wrote:Could you test this on my order, in your admin panel?? It should only take a couple minutes, and it'd confirm or debunk this issue, entirely (if it works, the error is not with OC.. if it doesn't work, we've found a bug).
Which version of OpenCart do you use? Also, do you use SMTP mailer or normal?TomGraves wrote:I just updated and order on http://www.countryfreezers.com using GoDaddy as a host and the email worked fine.
Any updates?Qphoria wrote:Ok i just sent an update to you yesterdaynpws wrote:Could you test this on my order, in your admin panel?? It should only take a couple minutes, and it'd confirm or debunk this issue, entirely (if it works, the error is not with OC.. if it doesn't work, we've found a bug).
As stated, I think this proves the issue is not just with my system... you sent me an update, and it never came through. Though, I was able to receive every other email you've ever sent to me.
I just got one from you (I assume you just sent it today) and it came through with a bunch of garbled HTML attached to it.Qphoria wrote:hmm but most people get the emails I sent. I just sent one to myself from my site and i got it. Maybe its just going to spam.
There is obviously an issue.
As for the people saying that theirs works so it must not be an issue- you are not helping at all because you are not providing any information. Are you using SMTP or PHPMail? What OC version are you using? Etc...
Looks like it was sent to you in html format but your email client read it as text.
The code shows:
which does exclaim that the content is text/html format, so that would tell me the email client can't read it properly
The code shows:
Code: Select all
<html dir="ltr" lang="en">
<head>
<title>test qphoric domain</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body><p>this is a test from Q</p></body>
</html>
I replied to the email and included the original, so you could see what it looks like. GMail must have parsed out the bad info, but the email was sent with Meta tags and an HTML header. Please check your email and let me know what you think. Thanks again for all the help!Qphoria wrote:i use the default php mail.. no smtp.
The text i sent was "test test" or something like that
are you opening it in outlook?
the one i sent to my gmail came out exactly as typed.
Any resolution to this yet?? I'm having the same issue. Emails are not going out from the Update order OR the Mail section of the Admin panel. I CAN send emails from my server though, as I posted a test emailer using PHP on my site, and I get the emails just fine.
What do I do???
What do I do???
The problem is that some servers are adding extra \n or \r\n to the mail headers. the server is the problem not opencart.
try replacing the mail class with this and tell me what happens.
also pm me your ftp details. i would like to do some testing on your server to see if i can fix this problem permanently.
try replacing the mail class with this and tell me what happens.
Code: Select all
<?php
final class Mail {
protected $to;
protected $from;
protected $sender;
protected $subject;
protected $text;
protected $html;
protected $attachments = array();
public $protocol = 'mail';
public $hostname;
public $username;
public $password;
public $port = 25;
public $timeout = 5;
public $charset = 'utf-8';
public $newline = "\n";
public $crlf = "\r\n";
public $verp = FALSE;
public function setTo($to) {
$this->to = $to;
}
public function setFrom($from) {
$this->from = $from;
}
public function addheader($header, $value) {
$this->headers[$header] = $value;
}
public function setSender($sender) {
$this->sender = $sender;
}
public function setSubject($subject) {
$this->subject = $subject;
}
public function setText($text) {
$text = str_replace("\r\n", "\n", $text);
$text = str_replace("\r", "\n", $text);
$text = str_replace("\n", $this->newline, $text);
$this->text = $text;
}
public function setHtml($html) {
$html = str_replace("\r\n", "\n", $html);
$html = str_replace("\r", "\n", $html);
$html = str_replace("\n", $this->newline, $html);
$this->html = $html;
}
public function addAttachment($attachment) {
if (!is_array($attachment)) {
$this->attachments[] = $attachment;
} else{
$this->attachments = array_merge($this->attachments, $attachment);
}
}
public function send() {
if (!$this->to) {
exit('Error: E-Mail to required!');
}
if (!$this->from) {
exit('Error: E-Mail from required!');
}
if (!$this->sender) {
exit('Error: E-Mail sender required!');
}
if (!$this->subject) {
exit('Error: E-Mail subject required!');
}
if ((!$this->text) && (!$this->html)) {
exit('Error: E-Mail message required!');
}
if (is_array($this->to)) {
$to = implode(',', $this->to);
} else {
$to = $this->to;
}
$boundary = '----=_NextPart_' . md5(time());
$header = '';
if ($this->protocol != 'mail') {
$header .= 'To: ' . $to . $this->newline;
$header .= 'Subject: ' . $this->subject . $this->newline;
}
$header .= 'From: ' . $this->sender . '<' . $this->from . '>' . $this->newline;
$header .= 'Reply-To: ' . $this->sender . '<' . $this->from . '>' . $this->newline;
$header .= 'Return-Path: ' . $this->from . $this->newline;
$header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;
$header .= 'MIME-Version: 1.0' . $this->newline;
$header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $this->newline;
if (!$this->html) {
$message = '--' . $boundary . $this->newline;
$message .= 'Content-Type: text/plain; charset="utf-8"' . $this->newline;
$message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;
$message .= $this->text . $this->newline;
} else {
$message = '--' . $boundary . $this->newline;
$message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . $this->newline . $this->newline;
$message .= '--' . $boundary . '_alt' . $this->newline;
$message .= 'Content-Type: text/plain; charset="utf-8"' . $this->newline;
$message .= 'Content-Transfer-Encoding: 8bit' . $this->newline;
if ($this->text) {
$message .= $this->text . $this->newline;
} else {
$message .= 'This is a HTML email and your email client software does not support HTML email!' . $this->newline;
}
$message .= '--' . $boundary . '_alt' . $this->newline;
$message .= 'Content-Type: text/html; charset="utf-8"' . $this->newline;
$message .= 'Content-Transfer-Encoding: 8bit' . $this->newline . $this->newline;
$message .= $this->html . $this->newline;
$message .= '--' . $boundary . '_alt--' . $this->newline;
}
foreach ($this->attachments as $attachment) {
$filename = basename($attachment);
$handle = fopen($attachment, 'r');
$content = fread($handle, filesize($attachment));
fclose($handle);
$message .= '--' . $boundary . $this->newline;
$message .= 'Content-Type: application/octetstream' . $this->newline;
$message .= 'Content-Transfer-Encoding: base64' . $this->newline;
$message .= 'Content-Disposition: attachment; filename="' . $filename . '"' . $this->newline;
$message .= 'Content-ID: <' . $filename . '>' . $this->newline . $this->newline;
$message .= chunk_split(base64_encode($content));
}
if ($this->protocol == 'mail') {
ini_set('sendmail_from', $this->from);
mail($to, $this->subject, $message, $header);
} elseif ($this->protocol == 'smtp') {
$handle = fsockopen($this->hostname, $this->port, $errno, $errstr, $this->timeout);
if (!$handle) {
error_log('Error: ' . $errstr . ' (' . $errno . ')');
} else {
if (substr(PHP_OS, 0, 3) != 'WIN') {
socket_set_timeout($handle, $this->timeout, 0);
}
while ($line = fgets($handle, 515)) {
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($this->hostname, 0, 3) == 'tls') {
fputs($handle, 'STARTTLS' . $this->crlf);
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 220) {
error_log('Error: STARTTLS not accepted from server!');
}
}
if (!empty($this->username) && !empty($this->password)) {
fputs($handle, 'EHLO ' . getenv('SERVER_NAME') . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 250) {
error_log('Error: EHLO not accepted from server!');
}
fputs($handle, 'AUTH LOGIN' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 334) {
error_log('Error: AUTH LOGIN not accepted from server!');
}
fputs($handle, base64_encode($this->username) . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 334) {
error_log('Error: Username not accepted from server!');
}
fputs($handle, base64_encode($this->password) . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 235) {
error_log('Error: Password not accepted from server!');
}
} else {
fputs($handle, 'HELO ' . getenv('SERVER_NAME') . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 250) {
error_log('Error: HELO not accepted from server!');
}
}
fputs($handle, 'MAIL FROM: <' . $this->from . '>' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 250) {
error_log('Error: MAIL FROM not accepted from server!');
}
if (!is_array($this->to)) {
fputs($handle, 'RCPT TO: <' . $this->to . '>' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {
error_log('Error: RCPT TO not accepted from server!');
}
} else {
foreach ($this->to as $recipient) {
fputs($handle, 'RCPT TO: <' . $recipient . '>' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if ((substr($reply, 0, 3) != 250) && (substr($reply, 0, 3) != 251)) {
error_log('Error: RCPT TO not accepted from server!');
}
}
}
fputs($handle, 'DATA' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 354) {
error_log('Error: DATA not accepted from server!');
}
fputs($handle, $header . $message . $this->crlf);
fputs($handle, '.' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 250) {
error_log('Error: DATA not accepted from server!');
}
fputs($handle, 'QUIT' . $this->crlf);
$reply = '';
while ($line = fgets($handle, 515)) {
$reply .= $line;
if (substr($line, 3, 1) == ' ') {
break;
}
}
if (substr($reply, 0, 3) != 221) {
error_log('Error: QUIT not accepted from server!');
}
fclose($handle);
}
}
}
}
?>
OpenCart®
Project Owner & Developer.
Who is online
Users browsing this forum: No registered users and 75 guests