get('engine.postproc.email.address', '')); $subject = $config->get('engine.postproc.email.subject', '0'); // Sanity checks if (empty($address)) { $this->setError('You have not set up a recipient\'s email address for the backup files'); return false; } // Send the file $basename = empty($upload_as) ? basename($absolute_filename) : $upload_as; Factory::getLog()->log(LogLevel::INFO, "Preparing to email $basename to $address"); if (empty($subject)) { if (class_exists('JText')) { $subject = \JText::_('AKEEBA_DEFAULT_EMAIL_SUBJECT'); } elseif (class_exists('\Awf\Text\Text')) { $subject = \Awf\Text\Text::_('AKEEBA_DEFAULT_EMAIL_SUBJECT'); } else { $subject = "You have a new backup part"; } } $body = "Emailing $basename"; Factory::getLog()->log(LogLevel::DEBUG, "Subject: $subject"); Factory::getLog()->log(LogLevel::DEBUG, "Body: $body"); $result = Platform::getInstance()->send_email($address, $subject, $body, $absolute_filename); // Return the result if ($result !== true) { // An error occurred $this->setError($result); // Notify that we failed return false; } else { // Return success Factory::getLog()->log(LogLevel::INFO, "Email sent successfully"); return true; } } }