<commit_before>package MGRAST::Mailer;

use strict;
use warnings;

use Net::SMTP;
use POSIX qw(strftime);


sub send_email {
    my (%args) = @_;
    
    
    my $smtp_host = $args{'smtp_host'};
    
    my $from = $args{'from'};
    my $to = $args{'to'};
    
    my $subject = $args{'subject'};
    my $body = $args{'body'};
    
    
    #my $smtp = Net::SMTP->new($Conf::smtp_host, Hello => $Conf::smtp_host);
    my $smtp = Net::SMTP->new($smtp_host, Hello => $smtp_host);
    
    my @data = (
        "To: $to\n",
        "From: $from\n",
        "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z", localtime)."\n",
        "Subject: $subject\n\n",
        $body
    );
    
    $smtp->mail('mg-rast');
    if ($smtp->to($to)) {
        $smtp->data(@data);
    } <commit_msg>add 1;<commit_after>package MGRAST::Mailer;

use strict;
use warnings;

use Net::SMTP;
use POSIX qw(strftime);

1;

sub send_email {
    my (%args) = @_;
    
    
    my $smtp_host = $args{'smtp_host'};
    
    my $from = $args{'from'};
    my $to = $args{'to'};
    
    my $subject = $args{'subject'};
    my $body = $args{'body'};
    
    
    #my $smtp = Net::SMTP->new($Conf::smtp_host, Hello => $Conf::smtp_host);
    my $smtp = Net::SMTP->new($smtp_host, Hello => $smtp_host);
    
    my @data = (
        "To: $to\n",
        "From: $from\n",
        "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z", localtime)."\n",
        "Subject: $subject\n\n",
        $body
    );
    
    $smtp->mail('mg-rast');
    if ($smtp->to($to)) {
        $smtp->data(@data);
    } 
{'fraction_non_alphanumeric': 0.22064516129032258, 'fraction_numerical': 0.0012903225806451613, 'mean_word_length': 2.2790697674418605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5969137', 'n_tokens_mistral': 672, 'n_tokens_neox': 636, 'n_words': 124}