A PHP maill function problem

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
cearlp
Forum Newbie
Posts: 4
Joined: Sat Nov 13, 2010 4:17 pm

A PHP maill function problem

Post by cearlp »

Having a problem with mail() in PHP code.
The message is a warning and the mail gets sent but I am wondering what I must do to get rid of the warning message.

Here is the message:
warning: mail/var/log/mail.log [function.mail]: failed to open stream: Permission denied in code on line 21.

Here is the code. As you can see it comes from the CMS product drupal.
function drupal_mail_send($message) {
// Allow for a custom mail backend.
if (variable_get('smtp_library', '') && file_exists(variable_get('smtp_library', ''))) {
include_once './'. variable_get('smtp_library', '');
return drupal_mail_wrapper($message);
}
else {
$mimeheaders = array();
foreach ($message['headers'] as $name => $value) {
$mimeheaders[] = $name .': '. mime_header_encode($value);
}
return mail(
$message['to'],
mime_header_encode($message['subject']),
// Note: e-mail uses CRLF for line-endings, but PHP's API requires LF.
// They will appear correctly in the actual e-mail that is sent.
str_replace("\r", '', $message['body']),
// For headers, PHP's API suggests that we use CRLF normally,
// but some MTAs incorrecly replace LF with CRLF. See #234403.
join("\n", $mimeheaders)
); <----------------------- this is line 21
}
}

Other code using PHP mail on the same Ubuntu system works without error or warning messages.
And, sInce I get no response from drupal forums I thought I would try here.
Thanks in advance.
Post Reply