https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32575

--- Comment #2 from David Cook <[email protected]> ---
Here's a little test program for using in koha-testing-docker:

#!/usr/bin/perl
use Modern::Perl;
use C4::Context;
use Koha::Email;
use Koha::SMTP::Servers;
my $transport = Koha::SMTP::Servers->get_default->transport;
my $email = Koha::Email->create(
        {
            from    => C4::Context->preference('KohaAdminEmailAddress'),
            to      => '[email protected]',
            subject => 'My test email',
        }
);
$email->header('Content-Type' => 'multipart/mixed');
my $filepath = '/tmp/notices_ODUE3-2024-06-17.csv';
my $filename = 'notices_ODUE3-2024-06-17.csv';
my $mimetype = 'text/csv';
$email->attach_file(
    $filepath,
    content_type => $mimetype,
    charset      => 'UTF-8',
    name         => $filename,
    disposition  => 'attachment',
);
$email->send_or_die( { transport => $transport } );

--

Some steps:
1. Set up the SMTP server config in koha-conf.xml for a server that works
2. Set up a valid email sender in KohaAdminEmailAddress
3. Create a little CSV file at /tmp/notices_ODUE3-2024-06-17.csv 
4. Run the program

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to