0

I am attempting to send email with attachment using pear mail package. I have coded as described by Maerlyn in PHP: How to send email with attachment using smtp settings? The mail is not being sent; I don't know how to debug. There is no output to this piece of code either:

if (PEAR::isError($mail)) {
        echo("<p>" . $mail->getMessage() . "</p>");
}

By echoing after each line of code, I figured out that this line of code fails, as php fails to echo anything placed after this line.

$mime = new Mail_mime(array('eol' => $crlf));

Pear package is correctly installed, as I am using successfully on other pages. I have also included include "Mail/mime.php";

Any idea what is going wrong here?

Community
  • 1
  • 1
sridhar
  • 1,321
  • 5
  • 17
  • 26
  • 1
    Well, you cannot help you if you do not tell us what error occurs. What do the http server logfiles say? What does the package error state say? – arkascha Oct 23 '13 at 07:58
  • No error message is seen; there is no entry in the error_log file too. Else, I would have mentioned it here. – sridhar Oct 23 '13 at 11:16
  • The only explanation for a silent fail without any error message anywhere (which I doubt, sorry, maybe you should look again, closer) would be that the php process is killed because it violates some limitation set in the php.ini directions. That might by maximum execution time or, more likely, maximum size of memory. In that case the process is killed and cannot write any error message any more. But then again, _if_ error logging is configured in a sane way, the fact that the process has been killed should be logged. – arkascha Oct 24 '13 at 06:49
  • I guess the mail_mime class is not available, because you didn't `require_once` it. – cweiske Nov 04 '13 at 13:44

1 Answers1

0

this silent death can happen because you have already included the "Mail/mime.php" somewhere else.. i.e. a double include call

user26676
  • 280
  • 3
  • 21