PM-246 New parameter Alternative Email Settings in PMFSendMessage

A new parameter $config (associative array) was added in the PMFSendMessage function:

Example:
array(
"MESS_ENGINE"=>"PHPMAILER",
"MESS_SERVER"=>"smtp.gmail.com",
"MESS_PORT"=>587,
"MESS_FROM_MAIL"=>"xxx@gmail.com",
"MESS_RAUTH" =>1,
"MESS_ACCOUNT"=>"xxx@gmail.com",
"MESS_PASSWORD"=>"15678=865",
"SMTPSecure"=>"tls"
)

The parameters of the array showed in the Example are all the necesary parameters.
This commit is contained in:
jennylee
2014-09-18 17:04:22 -04:00
parent d164a86054
commit d4dd0c61a3
2 changed files with 3 additions and 27 deletions

View File

@@ -914,37 +914,13 @@ class wsBase
$aAttachment = null,
$showMessage = true,
$delIndex = 0,
$config = null
$config = array()
) {
try {
if (!class_exists('System')) {
G::LoadClass('system');
}
$aSetup = System::getEmailConfiguration();
if($config != null){
if(isset($config['EmailEngine']) && $config['EmailEngine'] != ""){
$aSetup['MESS_ENGINE'] = $config['EmailEngine']; //EmailEngine
}
if(isset($config['Server']) && $config['Server'] != ""){
$aSetup['MESS_SERVER'] = $config['Server']; //Server
}
if(isset($config['Port']) && $config['Port'] != ""){
$aSetup['MESS_PORT'] = $config['Port']; //port
}
if(isset($config['UserName']) && $config['UserName'] != ""){
$aSetup['MESS_ACCOUNT'] = $config['UserName']; //userName
}
if(isset($config['FromEmail']) && $config['FromEmail'] != ""){
$aSetup['MESS_FROM_MAIL'] = $config['FromEmail']; //fromEmail
}
if(isset($config['UserPassword']) && $config['UserPassword'] != ""){
$aSetup['MESS_PASSWORD'] = $config['UserPassword']; //userPassword
}
if(isset($config['SecureConnection']) && $config['SecureConnection'] != ""){
$aSetup['SMTPSecure'] = $config['SecureConnection']; //secureConnection
}
}
$aSetup = !empty($config) ? $config : System::getEmailConfiguration();
$oSpool = new spoolRun();