Jump to content

fixing a error?


Im Jake

Recommended Posts

Fatal error: Cannot redeclare class Mailer in /home/imjake/public_html/includes/mailer.php on line 3

 

<? 
class Mailer
{
   /**
    * sendWelcome - Sends a welcome message to the newly
    * registered user, also supplying the username and
    * password.
    */
   function sendWelcome($user, $email, $pass){
      global $settings,$HTTP_SERVER_VARS;
  $from = "From: ".$HTTP_SERVER_VARS['SERVER_ADMIN']." <".$HTTP_SERVER_VARS['SERVER_ADMIN'].">";
      $subject = $settings['site_title']." - Welcome!";
      $body = $user.",\n\n"
             ."Welcome! You've just registered at ".$settings['site_title']
             ." with the following information:\n\n"
             ."Username: ".$user."\n"
             ."Password: ".$pass."\n\n"
             ."If you ever lose or forget your password, a new "
             ."password will be generated for you and sent to this "
             ."email address, if you would like to change your "
             ."email address you can do so by going to the "
             ."My Account page after signing in.\n\n"
             ."- ".$settings['site_title']."\n".$settings['urlname'];

      return mail($email,$subject,$body,$from);
   }

Link to comment
https://forums.phpfreaks.com/topic/145258-fixing-a-error/
Share on other sites

You probably included that file twice by accident. Change all include()s to include_once()s and the same for require()s and see if that fixes your problem. If it doesn't, try to find out why you have two classes named Mailer.

 

"require_once()" Is recommended ;) Hey jake.

Link to comment
https://forums.phpfreaks.com/topic/145258-fixing-a-error/#findComment-762583
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.