function _simplenews_set_from in Simplenews 7
Same name and namespace in other branches
- 6.2 includes/simplenews.mail.inc \_simplenews_set_from()
- 6 simplenews.module \_simplenews_set_from()
- 7.2 includes/simplenews.mail.inc \_simplenews_set_from()
Build formatted from-name and email for a mail object.
Return value
Associative array with (un)formatted from address 'address' => From address 'formatted' => Formatted, mime encoded, from name and address
2 calls to _simplenews_set_from()
- simplenews_confirmation_send in ./
simplenews.module - Send a confirmation mail.
- simplenews_confirmation_send_combined in ./
simplenews.module - Send collected confirmations.
File
- includes/
simplenews.mail.inc, line 638 - Simplenews email send and spool handling
Code
function _simplenews_set_from() {
$address_default = variable_get('site_mail', ini_get('sendmail_from'));
$name_default = variable_get('site_name', 'Drupal');
$address = variable_get('simplenews_from_address', $address_default);
$name = variable_get('simplenews_from_name', $name_default);
// Windows based PHP systems don't accept formatted email addresses.
$formatted_address = drupal_substr(PHP_OS, 0, 3) == 'WIN' ? $address : '"' . addslashes(mime_header_encode($name)) . '" <' . $address . '>';
return array(
'address' => $address,
'formatted' => $formatted_address,
);
}