function _mailhandler_get_fromaddress in Mailhandler 7.2
Same name and namespace in other branches
- 6.2 mailhandler.module \_mailhandler_get_fromaddress()
Determines 'from' address.
Determines 'from' address using either the mailbox setting or via the header.
Parameters
object $header: Object message header information.
array $mailbox: Array mailbox settings.
Return value
array array of the 'from' address and 'from' name.
3 calls to _mailhandler_get_fromaddress()
- MailhandlerAuthenticateDefault::authenticate in plugins/
mailhandler/ authenticate/ MailhandlerAuthenticateDefault.class.php - Implements authenticate().
- MailhandlerAuthenticateTokenauth::authenticate in modules/
mailhandler_tokenauth/ plugins/ mailhandler/ authenticate/ MailhandlerAuthenticateTokenauth.class.php - Implements authenticate().
- MailhandlerMultipleEmailAuthenticate::authenticate in modules/
mailhandler_multiple_email/ plugins/ mailhandler/ authenticate/ MailhandlerMultipleEmailAuthenticate.class.php - Implements authenticate().
File
- ./
mailhandler.module, line 272 - Retrieves email for posting as nodes and comments.
Code
function _mailhandler_get_fromaddress($header, $mailbox) {
$fromheader = drupal_strtolower($mailbox->settings['fromheader']);
$from = $header->{$fromheader};
return array(
$from[0]->mailbox . '@' . $from[0]->host,
isset($from[0]->personal) ? $from[0]->personal : '',
);
}