SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Evangelist stef25's Avatar
    Join Date
    Nov 2004
    Location
    belgium
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    uncaught exception + stack trace

    below is an error generated by a script that functions fine on another server. it refers to a class used for sending email via a tell a friend form.

    Code:
    Fatal error: Uncaught exception 'Exception' with message 'Sending mail failed.' in /home/xxx/public_html/scripts/class.simpleMail.php:80 Stack trace: #0 /home/xxx/public_html/products/taf.php(30): simpleMail->send() #1 {main} thrown in /home/xxx/public_html/scripts/class.simpleMail.php on line 80
    line 80 below, where the error's coming from.

    Code:
    if (!mail($this->to,$this->subject,$this->message,$this->headers)){
    throw new Exception('Sending mail failed.');
    return FALSE;}
    since it works fine on another server im thinking this is something to do with the php config? what does stack trace mean?

    thx
    stef
    I need someone to protect me from
    all the measures they take in order to protect me

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That code is a good example of how not to use exceptions. Remove "throw", set error_reporting to E_ALL and look what error messages you get.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •