$hdrs = $mime->headers($hdrs);
$textHeaders = '';
foreach ($hdrs as $k => $v) {
- $textHeaders .= $k . ':' . $v . "\n";
+ $textHeaders .= $k . ': ' . $v . "\n";
}
- foreach ((array) $this->config->get('mail_to') as $recipient) {
- mail($recipient, $subject, $body, $textHeaders);
+ if (!$this->config->get('debug', false)) {
+ foreach ((array) $this->config->get('mail_to') as $recipient) {
+ mail($recipient, $subject, $body, $textHeaders);
+ }
+ } else {
+ echo "Subject: " . $subject . "\n";
+ echo $textHeaders;
+ echo "\n";
+ echo $body;
}
}
'action' => 'StoreString'
)
);
+ $parser->addOption(
+ 'debug',
+ array(
+ 'long_name' => '--debug',
+ 'description' => 'Development helper (mail)',
+ 'action' => 'StoreTrue'
+ )
+ );
return $parser;
}
$this->config->daysNext = $result->options['daysNext'];
$this->config->daysPrev = $result->options['daysPrev'];
+ $this->config->debug = $result->options['debug'];
$this->config->renderer = $result->options['renderer'];
$this->config->stopOnEmpty = $result->options['stopOnEmpty'];
$this->config->setDate($result->options['date']);