Changeset 460
- Timestamp:
- Nov 5, 2012, 10:12:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r459 r460 133 133 while($DbRow = $DbResult->fetch_assoc()) 134 134 { 135 $Mail->AddTo ($DbRow['To']);135 $Mail->AddToCombined($DbRow['To']); 136 136 $Mail->Subject = $DbRow['Subject']; 137 137 $Mail->From = $DbRow['From']; 138 138 $Mail->AddBody(strip_tags($DbRow['Content']), 'text/plain'); 139 139 $Mail->AddBody($DbRow['Content'], 'text/html'); 140 if($DbRow['AttachmentFile'] != ' NULL')140 if($DbRow['AttachmentFile'] != '') 141 141 { 142 $DbResult2 = $this->Data ase->select('File', '*', 'Id='.$DbRow['AttachmentFile']);143 $File = $DbResult2->fetch_assoc();144 $Mail->AttachFile($this->Config['Web']['FileRootFolder'].$File['DrivePath'], $File['MimeType']);142 $DbResult2 = $this->Database->select('File', '*', 'Id='.$DbRow['AttachmentFile']); 143 while($File = $DbResult2->fetch_assoc()) 144 $Mail->AttachFile($this->Config['Web']['FileRootFolder'].$File['DrivePath'], $File['MimeType']); 145 145 } 146 146 $Mail->Send(); -
trunk/Common/Mail.php
r438 r460 41 41 } 42 42 43 function AddToCombined($Address) 44 { 45 $this->Recipients[] = array('Address' => $Address, 'Type' => 'SendCombined'); 46 } 47 43 48 function AddTo($Address, $Name) 44 49 { … … 100 105 foreach($this->Recipients as $Index => $Recipient) 101 106 { 107 if($Recipient['Type'] == 'SendCombined') 108 { 109 if($Index > 0) $To .= ', '; 110 $To .= $Recipient['Address']; 111 } else 102 112 if($Recipient['Type'] == 'Send') 103 113 { … … 119 129 120 130 $this->Headers['Mime-Version'] = '1.0'; 121 if(count($this->Attachments) == 0)122 {123 $this->Headers['Content-Type'] = $this->Bodies[0]['Type'].'; charset='.$this->Bodies[0]['Charset'];124 $this->Headers['Content-Transfer-Encoding'] = $this->ContentEncoding($this->Bodies[0]['Charset']);125 }126 131 127 132 if($this->AgentIdent != '') $this->Headers['X-Mailer'] = $this->AgentIdent; … … 169 174 private function BuildAttachment($Body) 170 175 { 171 if(count($this->Attachments > 0))172 { 176 if(count($this->Attachments) > 0) 177 { 173 178 $this->Headers['Content-Type'] = "multipart/mixed;\n boundary=\"PHP-mixed-".$this->Boundary."\""; 174 175 179 $Result = "This is a multi-part message in MIME format.\n". 176 180 "--PHP-mixed-".$this->Boundary."\n"; … … 206 210 $Result = ''; 207 211 if(count($this->Bodies) > 1) 212 { 213 $this->Headers['Content-Type'] = 'multipart/alternative; boundary="PHP-alt-'.$this->Boundary.'"'; 208 214 $Result .= 'Content-Type: multipart/alternative; boundary="PHP-alt-'.$this->Boundary.'"'. 209 215 "\n\n"; 216 } else 217 { 218 $this->Headers['Content-Type'] = $this->Bodies[0]['Type'].'; charset='.$this->Bodies[0]['Charset']; 219 $this->Headers['Content-Transfer-Encoding'] = $this->ContentEncoding($this->Bodies[0]['Charset']); 220 } 221 210 222 211 223 foreach($this->Bodies as $Body) -
trunk/sql/updates/459.sql
r459 r460 2 2 3 3 ALTER TABLE `EmailQueue` CHANGE `Address` `To` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL; 4 ALTER TABLE `EmailQueue` CHANGE `AttachmentFile` `AttachmentFile` INT( 11 ) NULL ; 5 UPDATE `EmailQueue` SET AttachmentFile = NULL WHERE AttachmentFile=0;
Note:
See TracChangeset
for help on using the changeset viewer.