public function HTMLMailSystem::txtHeaders in HTML Mail 8.2
Same name and namespace in other branches
- 6.2 htmlmail.mail.inc \HTMLMailSystem::txtHeaders()
- 7.2 htmlmail.mail.inc \HTMLMailSystem::txtHeaders()
Converts an array of email headers to a text string.
Parameters
$headers: An associative array of ('HeaderName' => 'header value') pairs.
Return value
The concatenated headers as a single string.
1 call to HTMLMailSystem::txtHeaders()
- HTMLMailSystem::mail in ./
htmlmail.mail.inc - Send an email message.
File
- ./
htmlmail.mail.inc, line 308 - Formats and sends mail using the MailMIME class.
Class
- HTMLMailSystem
- Implements MailSystemInterface.
Code
public function txtHeaders(array $headers) {
$output = array();
foreach ($headers as $name => $value) {
if (is_array($value)) {
foreach ($value as $val) {
$output[] = "{$name}: {$val}";
}
}
else {
$output[] = "{$name}: {$value}";
}
}
return implode("\n", $output);
}