Post by Daniel » Sat Nov 21, 2009 2:50 am

For people who have been having trouble with sending emails shoudl try this:

Code: Select all

<?php 
final class Mail { 
	protected $to;
  	protected $from;
  	protected $sender;
  	protected $subject;
  	protected $text;
  	protected $html;
  	protected $attachments = array();
	protected $protocol = 'mail';
	protected $hostname;
	protected $username;
	protected $password;
	protected $port = 25;
	protected $timeout = 5;

	public function __construct($protocol = 'mail', $hostname = '', $username = '', $password = '', $port = '25', $timeout = '5') {
		$this->protocol = $protocol;
		$this->hostname = $hostname;
		$this->username = $username;
		$this->password = $password;
		$this->port = $port;
		$this->timeout = $timeout;	
	}
	
	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) {
    	$this->text = $text;
  	}

  	public function setHtml($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(rand());  

		if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { 
      		$eol = "\r\n"; 
    	} elseif (strtoupper(substr(PHP_OS, 0, 3)=='MAC')) { 
      		$eol = "\r"; 
    	} else { 
      		$eol = "\n"; 
    	} 	
		
		$header = '';
		
		if ($this->protocol != 'mail') {
			$header .= 'To: ' . $to . $eol;
			$header .= 'Subject: ' . $this->subject . $eol;
		}
		
		$header .= 'From: ' . $this->sender . '<' . $this->from . '>' . $eol; 
    	$header .= 'Reply-To: ' . $this->sender . '<' . $this->from . '>' . $eol;   
		$header .= 'Return-Path: ' . $this->from . $eol;
		$header .= 'X-Mailer: PHP/' . phpversion() . $eol;  
    	$header .= 'MIME-Version: 1.0' . $eol; 
		$header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $eol;  
	
		if (!$this->html) {
	  		$message  = '--' . $boundary . $eol;  
	  		$message .= 'Content-Type: text/plain; charset="utf-8"' . $eol; 
	  		$message .= 'Content-Transfer-Encoding: base64' . $eol . $eol;
      		$message .= chunk_split(base64_encode($this->text), 76, $eol);
		} else {
	  		$message  = '--' . $boundary . $eol;
	  		$message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . $eol . $eol;
	  		$message .= '--' . $boundary . '_alt' . $eol;
	  		$message .= 'Content-Type: text/plain; charset="utf-8"' . $eol; 
	  		$message .= 'Content-Transfer-Encoding: base64' . $eol;
	  
	  		if ($this->text) {
        		$message .= chunk_split(base64_encode($this->text), 76, $eol);
	  		} else {
	    		$message .= chunk_split(base64_encode('This is a HTML email and your email client software does not support HTML email!'), 76, $eol);
      		}	
	  
	  		$message .= '--' . $boundary . '_alt' . $eol;
      		$message .= 'Content-Type: text/html; charset="utf-8"' . $eol; 
      		$message .= 'Content-Transfer-Encoding: base64' . $eol . $eol;
	  		$message .= chunk_split(base64_encode($this->html), 76, $eol); 
			$message .= '--' . $boundary . '_alt--' . $eol;		 
		}
		
    	foreach ($this->attachments as $attachment) {  
      		$filename = basename($attachment);  
      		$handle = fopen($attachment, 'r'); 
      		$content = fread($handle, filesize($attachment));
      
	  		fclose($handle);  
	  
      		$message .= '--' . $boundary . $eol;
      		$message .= 'Content-Type: application/octetstream' . $eol;    
      		$message .= 'Content-Transfer-Encoding: base64' . $eol; 
      		$message .= 'Content-Disposition: attachment; filename="' . $filename . '"' . $eol; 
      		$message .= 'Content-ID: <' . $filename . '>' . $eol . $eol;
      		$message .= chunk_split(base64_encode($content), 76, $eol);
    	}  

		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' . $eol);
					
					
					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') . $eol);
					
					$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' . $eol);
	
					$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) . $eol);
	
					$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) . $eol);
	
					$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') . $eol);
	
					$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 . '>XVERP' . $eol);
	
				$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 . '>' . $eol);
		
					$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 . '>' . $eol);
			
						$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' . $eol);
	
				$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 . $eol);
				fputs($handle, '.' . $eol);
				
				$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' . $eol);
	
				$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);
			}
		}
	}
}
?>
just replace the code in system/library/mail.php

The problem was due to the fact that the RFC standard of sending mails indicates you should use \r\n for new lines. Some linux servers only accept \n

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by djw » Sat Nov 21, 2009 8:12 am

just changed over the code and now i get this error on the index page of the site.

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

* Please contact the web site owners to inform them of this problem.

djw
New member

Posts

Joined
Fri Nov 20, 2009 7:24 am

Post by Darkgod » Sun Nov 22, 2009 1:36 pm

Problem continues.
Give an error message like the following when you update the code and push mail still can not be displayed properly.

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/user/public_html/system/library/mail.php:1) in /home/user/public_html/system/library/session.php on line 11
------=_NextPart_628732116924b22154005d05b424171e
Content-Type: multipart/alternative; boundary="----=_NextPart_628732116924b22154005d05b424171e_alt"

------=_NextPart_628732116924b22154005d05b424171e_alt
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
VGhpcyBpcyBhIEhUTUwgZW1haWwgYW5kIHlvdXIgZW1haWwgY2xpZW50IHNvZnR3YXJlIGRvZXMg
bm90IHN1cHBvcnQgSFRNTCBlbWFpbCE=
------=_NextPart_628732116924b22154005d05b424171e_alt
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64

PGh0bWwgZGlyPSJsdHIiIGxhbmc9ImVuIj4KPGhlYWQ+Cjx0aXRsZT5LYXJha3RlciBzb3J1bnUg
TWFpbDwvdGl0bGU+CjxtZXRhIGh0dHAtZXF1aXY9IkNvbnRlbnQtVHlwZSIgY29udGVudD0idGV4
dC9odG1sOyBjaGFyc2V0PVVURi04Ij4KPC9oZWFkPgo8Ym9keT48cD4NCglLYXJha3RlciBzb3J1
bnUgTWFpbEthcmFrdGVyIHNvcnVudSBNYWlsS2FyYWt0ZXIgc29ydW51IE1haWxLYXJha3RlciBz
b3J1bnUgTWFpbDwvcD4NCjwvYm9keT4KPC9odG1sPgo=
------=_NextPart_628732116924b22154005d05b424171e_alt--

Use the following code when this error shows normal mail goes alone.

Code: Select all

    <?php
    final class Mail {
       protected $to;
         protected $from;
         protected $sender;
         protected $subject;
         protected $text;
         protected $html;
         protected $attachments = array();
       protected $protocol = 'mail';
       protected $hostname;
       protected $username;
       protected $password;
       protected $port = 25;
       protected $timeout = 5;
       public $charset = 'utf-8';
       public $eol = "\r\n";

       public function __construct($protocol = 'mail', $hostname = '', $username = '', $password = '', $port = '25', $timeout = '5') {
          $this->protocol = $protocol;
          $this->hostname = $hostname;
          $this->username = $username;
          $this->password = $password;
          $this->port = $port;
          $this->timeout = $timeout;   
       }
       
       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) {
           $this->text = $text;
         }

         public function setHtml($html) {
           $this->html = $html;
         }
       
         public function addAttachment($attachments) {
           $this->attachments[] = $attachments;
         }

         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(rand()); 
         
          $header = '';
         
          if ($this->protocol != 'mail') {
             $header .= 'To: ' . $to . $this->eol;
             $header .= 'Subject: ' . $this->subject . $this->eol;
          }
         
          $header .= 'From: ' . $this->sender . '<' . $this->from . '>' . $this->eol;
           $header .= 'Reply-To: ' . $this->sender . '<' . $this->from . '>' . $this->eol;   
          $header .= 'Return-Path: ' . $this->from . $this->eol;
          $header .= 'X-Mailer: PHP/' . phpversion() . $this->eol; 
           $header .= 'MIME-Version: 1.0' . $this->eol;
          $header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . $this->eol; 
       
          if (!$this->html) {
               $message  = '--' . $boundary . $this->eol; 
               $message .= 'Content-Type: text/plain; charset="' . $this->charset . '"' . $this->eol;
               $message .= 'Content-Transfer-Encoding: base64' . $this->eol . $this->eol;
                $message .= chunk_split(base64_encode($this->text));
          } else {
               $message  = '--' . $boundary . $this->eol;
               $message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . $this->eol . $this->eol;
               $message .= '--' . $boundary . '_alt' . $this->eol;
               $message .= 'Content-Type: text/plain; charset="' . $this->charset . '"' . $this->eol;
               $message .= 'Content-Transfer-Encoding: base64' . $this->eol;
         
               if ($this->text) {
                  $message .= chunk_split(base64_encode($this->text));
               } else {
                 $message .= chunk_split(base64_encode('This is a HTML email and your email client software does not support HTML email!'));
                }   
         
               $message .= '--' . $boundary . '_alt' . $this->eol;
                $message .= 'Content-Type: text/html; charset="' . $this->charset . '"' . $this->eol;
                $message .= 'Content-Transfer-Encoding: base64' . $this->eol . $this->eol;
               $message .= chunk_split(base64_encode($this->html));
             $message .= '--' . $boundary . '_alt--' . $this->eol;     
          }
         
           foreach ($this->attachments as $attachment) { 
                $filename = basename($attachment); 
                $handle = fopen($attachment, 'r');
                $content = fread($handle, filesize($attachment));
         
               fclose($handle); 
         
                $message .= '--' . $boundary . $this->eol;
                $message .= 'Content-Type: application/octetstream' . $this->eol;   
                $message .= 'Content-Transfer-Encoding: base64' . $this->eol;
                $message .= 'Content-Disposition: attachment; filename="' . $filename . '"' . $this->eol;
                $message .= 'Content-ID: <' . $filename . '>' . $this->eol . $this->eol;
                $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 (!empty($this->username)  && !empty($this->password)) {
                   fputs($handle, 'EHLO ' . getenv('SERVER_NAME') . $this->eol);
                   
                   $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->eol);
       
                   $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->eol);
       
                   $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->eol);
       
                   $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->eol);
       
                   $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 . '>XVERP' . $this->eol);
       
                $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->eol);
         
                   $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->eol);
             
                      $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->eol);
       
                $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->eol);
                fputs($handle, '.' . $this->eol);
               
                $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->eol);
       
                $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);
             }
          }
       }
    }
    ?>
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/user/public_html/system/library/mail.php:1) in /home/user/public_html/system/library/session.php on line 11Warning: basename() expects parameter 1 to be string, array given in /home/user/public_html/system/library/mail.php on line 129Warning: fopen() expects parameter 1 to be string, array given in /home/user/public_html/system/library/mail.php on line 130Notice: Array to string conversion in /home/user/public_html/system/library/mail.php on line 131Warning: filesize() [function.filesize]: stat failed for Array in /home/user/public_html/system/library/mail.php on line 131Warning: fread(): supplied argument is not a valid stream resource in /home/user/public_html/system/library/mail.php on line 131Warning: fclose(): supplied argument is not a valid stream resource in /home/user/public_html/system/library/mail.php on line 133
Note: do not use SMTP to send normal sending part.

Newbie

Posts

Joined
Fri Nov 20, 2009 12:22 pm

Post by Daniel » Sun Nov 22, 2009 7:15 pm

you guys obversly don;t know how to code.

make sure there are no white spaces after and before <?php ?>

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Darkgod » Mon Nov 23, 2009 6:08 am

OK so do you think of seeing. Do you share a zip or rar format?

I do not think I made a mistake but it works I could not comment on matters under.
Thanks for your help.

Newbie

Posts

Joined
Fri Nov 20, 2009 12:22 pm

Post by arrakis99 » Wed Dec 02, 2009 4:59 pm

Hi,
THE PROBLEM PERSISTS... I've changed the mail class as suggested and It seemed to work:
works if I send to a gmail or yahoo account BUT If a client of mine download the mail with Outlook,
the mail is unreadable....
... I really can't ask to my clients to change the email client...

PLEASE HELP ME

My server is a Suse Linux

Thanks a lot

Giulio Acerbi

New member

Posts

Joined
Thu Jul 16, 2009 5:50 pm

Post by deeve » Wed Dec 09, 2009 8:18 am

Same problem here. Just made update as in first post. On UK2.net Linux server using 'Mail' option get email in Outlook with this in body of email:

Code: Select all

------=_NextPart_c9ae963dc98d6725555db7674fadf9bf
Content-Type: multipart/alternative; boundary="----=_NextPart_c9ae963dc98d6725555db7674fadf9bf_alt"

------=_NextPart_c9ae963dc98d6725555db7674fadf9bf_alt
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
VGhpcyBpcyBhIEhUTUwgZW1haWwgYW5kIHlvdXIgZW1haWwgY2xpZW50IHNvZnR3YXJlIGRvZXMg
bm90IHN1cHBvcnQgSFRNTCBlbWFpbCE=
------=_NextPart_c9ae963dc98d6725555db7674fadf9bf_alt
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64

PGh0bWwgZGlyPSJsdHIiIGxhbmc9ImVuIj4KPGhlYWQ+Cjx0aXRsZT5UZXN0IDQ8L3RpdGxl
PGh0bWwgZGlyPSJsdHIiIGxhbmc9ImVuIj4KPGhlYWQ+Pgo8
bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNl
dD1VVEYtOCI+CjwvaGVhZD4KPGJvZHk+PHA+DQoJPHN0cm9uZz5UZXN0aW5nPC9zdHJvbmc+IHRl
c3RpbiAxMjMuLi48L3A+DQo8L2JvZHk+CjwvaHRtbD4K
------=_NextPart_c9ae963dc98d6725555db7674fadf9bf_alt--
along with a txt file attachment.

If I use SMTP option email is not sent/received & get php error in Admin>Customer>Mail header of:

Code: Select all

Warning: fsockopen() [function.fsockopen]: unable to connect to mail.uptightrecords.co.uk:25 (Connection refused) in /mypath/system/library/mail.php on line 158
plus Admin nav CSS all messed up on drop-down.

Line 158 is:

Code: Select all

         $handle = fsockopen($this->hostname, $this->port, $errno, $errstr, $this->timeout);   

Active Member

Posts

Joined
Tue Oct 20, 2009 4:31 pm

Post by Daniel » Wed Dec 09, 2009 8:33 am

thwe is a nother post around with a better fix from another user.

I don;t know why you have brought this post up again.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by deeve » Wed Dec 09, 2009 8:35 am

Because I searched the forum and this thread came up. Previous entry was Dec 2nd so didn't appear that cold.

Just found latest thread here & posted update to my particular prob:
http://forum.opencart.com/viewtopic.php ... 55&start=0

Active Member

Posts

Joined
Tue Oct 20, 2009 4:31 pm

Post by thewanderer » Mon Dec 14, 2009 6:39 am

I am using the latest version of OC and on two different servers can not send emails, i get no errors if set to email or SMTP and the mail sent verification message appears in green.
I have no idea where to start looking as i have no errors.
Anyone else having mail problems?

New member

Posts

Joined
Fri Dec 04, 2009 7:07 am
Who is online

Users browsing this forum: No registered users and 15 guests