aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_mail.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_mail.inc.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index d965fc8c5..160ac1bfb 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -795,22 +795,24 @@ function pwg_send_mail($result, $to, $subject, $content, $headers)
{
global $conf, $user, $lang_info;
$dir = $conf['local_data_dir'].'/tmp';
- @mkdir( $dir );
- $filename = $dir.'/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme'];
- if ($args['content_format'] == 'text/plain')
+ if ( mkgetdir( $dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) )
{
- $filename .= '.txt';
- }
- else
- {
- $filename .= '.html';
+ $filename = $dir.'/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme'];
+ if ($args['content_format'] == 'text/plain')
+ {
+ $filename .= '.txt';
+ }
+ else
+ {
+ $filename .= '.html';
+ }
+ $file = fopen($filename, 'w+');
+ fwrite($file, $to ."\n");
+ fwrite($file, $subject ."\n");
+ fwrite($file, $headers);
+ fwrite($file, $content);
+ fclose($file);
}
- $file = fopen($filename, 'w+');
- fwrite($file, $to ."\n");
- fwrite($file, $subject ."\n");
- fwrite($file, $headers);
- fwrite($file, $content);
- fclose($file);
return $result;
}
add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);*/