From: Benni Bärmann <benni@obda.de>
Date: Sun, 23 Sep 2012 10:27:54 +0000 (+0200)
Subject: Merge branch 'master' of aymargeddon.de:/var/cache/git/aymargeddon/current
X-Git-Url: http://aymargeddon.de/gitweb/?a=commitdiff_plain;h=05176fd6f49774b1ce2e785e220b534e436fcab2;p=aymargeddon%2Fcurrent.git

Merge branch 'master' of aymargeddon.de:/var/cache/git/aymargeddon/current
---

05176fd6f49774b1ce2e785e220b534e436fcab2
diff --cc src/FROGS/DataBase.pm
index 81fe166,7bc8de1..9a43f69
--- a/src/FROGS/DataBase.pm
+++ b/src/FROGS/DataBase.pm
@@@ -397,21 -397,28 +397,33 @@@ sub new_account
   			       });
    $self->commit();
  
-   my $mail = "From: registration\@aymargeddon.de\nTo: $name <$email>\n"
-            . "Subject: ".$self->loc('REGISTER_MAIL_SUBJECT')."\n\n"
-            . $self->loc('REGISTER_MAIL_TEXT', $name, $login, $pwd)."\n";
+   # my $mail = "From: registration\@aymargeddon.de\nTo: $name <$email>\n"
+   #         . "Subject: ".$self->loc('REGISTER_MAIL_SUBJECT')."\n\n"
+   #         . $self->loc('REGISTER_MAIL_TEXT', $name, $login, $pwd)."\n";
  
    # print $mail;
 +# aus man mail:
 +#           env MAILRC=/dev/null from=scriptreply@domain smtp=host \
 +#                smtp-auth-user=login smtp-auth-password=secret \
 +#               smtp-auth=login mailx -n -s "subject" \
 +#              -a attachment_file recipient@domain <content_file
  
-   open(SENDMAIL, "|mail $email") or Util::log("Can't fork for sendmail: $!",0);
-   print SENDMAIL $mail;
-   close(SENDMAIL) or Util::log("sendmail didn't close nicely",0);
- 
+   # open(SENDMAIL, "|mail $email") or Util::log("Can't fork for sendmail: $!",0);
+   # print SENDMAIL $mail;
+   # close(SENDMAIL) or Util::log("sendmail didn't close nicely",0);
+ 
+   use Mail::Mailer;
+     
+   my $mailer = Mail::Mailer->new();
+     
+   $mailer->open({   From => 'benni@aymargeddon.de',
+ 		    To => "$name <$email>",
+ 		    Subject => $self->loc('REGISTER_MAIL_SUBJECT'),
+ 		})
+       or Util::log("can't send registration mail to $email: $!\n");
+   print $mailer $self->loc('REGISTER_MAIL_TEXT', $name, $login, $pwd);
+   $mailer->close();
+         
    return $pwd;
  }