BUG 3910 Attachments to email messages

added attachment option, at least one or more  attachment file
This commit is contained in:
Carlos Pacha
2011-08-17 10:41:06 -04:00
parent 67d8a149cc
commit 853bd5be48
4 changed files with 8 additions and 5 deletions

View File

@@ -1359,7 +1359,7 @@ class PHPMailer {
4 => $type, 4 => $type,
5 => false, // isStringAttachment 5 => false, // isStringAttachment
6 => 'attachment', 6 => 'attachment',
7 => 0 7 => count($this->attachment)
); );
} catch (phpmailerException $e) { } catch (phpmailerException $e) {

View File

@@ -773,7 +773,7 @@ function getEmailConfiguration () {
* *
*/ */
//@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value. //@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value.
function PMFSendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $sAttachment) { function PMFSendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $sAttachment = array()) {
G::LoadClass('wsBase'); G::LoadClass('wsBase');
$ws = new wsBase (); $ws = new wsBase ();

View File

@@ -386,8 +386,11 @@ class spoolRun {
} }
$oPHPMailer->Body = $msBody; $oPHPMailer->Body = $msBody;
if($this->fileData['attachments']) if(is_array($this->fileData['attachments'])){
$oPHPMailer->AddAttachment($this->fileData['attachments']); foreach($this->fileData['attachments'] as $key => $fileAttach){
$oPHPMailer->AddAttachment($fileAttach);
}
}
foreach( $this->fileData['envelope_to'] as $sEmail ) { foreach( $this->fileData['envelope_to'] as $sEmail ) {
$evalMail = strpos($sEmail, '<'); $evalMail = strpos($sEmail, '<');
if( strpos($sEmail, '<') !== false ) { if( strpos($sEmail, '<') !== false ) {

View File

@@ -596,7 +596,7 @@ class wsBase
* @param $appFields = null * @param $appFields = null
* @return $result will return an object * @return $result will return an object
*/ */
public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $sAttachment ) { public function sendMessage($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $sAttachment = null ) {
try { try {
$aSetup = getEmailConfiguration(); $aSetup = getEmailConfiguration();