function swiftmailer_is_multipart in Swift Mailer 7
Same name and namespace in other branches
- 8.2 includes/helpers/utilities.inc \swiftmailer_is_multipart()
- 8 includes/helpers/utilities.inc \swiftmailer_is_multipart()
Validates whether a message is multipart or not.
Parameters
array $message: The message which is to be validatet.
Return value
boolean A boolean indicating whether the message is multipart or not.
1 call to swiftmailer_is_multipart()
- SWIFTMailSystem::mail in includes/
classes/ SWIFTMailSystem.inc - Sends a message composed by drupal_mail().
File
- includes/
helpers/ utilities.inc, line 130 - This file contains general utility functions.
Code
function swiftmailer_is_multipart(&$message) {
$parts = 0;
if (!empty($message['body'])) {
$parts++;
}
if (!empty($message['plain'])) {
$parts++;
}
if (!empty($message['params']['files'])) {
$parts++;
}
if (!empty($message['params']['images'])) {
$parts++;
}
return $parts > 1 ? TRUE : FALSE;
}