Swift Mailer - Can't send mail, and can't find error logs

前端 未结 3 1022
后悔当初
后悔当初 2020-12-16 18:57

New to PHP and Swiftmailer and have yet to get it working. I\'ve uploaded the /lib/ directory to a directory in the root of my shared webserver from Hostgator. I\'ve uploade

3条回答
  •  死守一世寂寞
    2020-12-16 19:45

    Under your swift mailer extension there is an exception handler.

    root/lib/classes/Swift/SwiftException.php

    By default it does some convoluted things with errors to make it really hard to find them. Most of the pages out there also recommend equally convoluted ways of logging the errors.

    If you just want to see the error, add an echo, like below (or whatever else you might want to do with it).

    class Swift_SwiftException extends Exception
    {
    
        /**
         * Create a new SwiftException with $message.
         *
         * @param string $message
         */
        public function __construct($message)
        {
            echo $message;
            parent::__construct($message);
        }
    }
    

提交回复
热议问题