1
2
3
4
5
6
7
8
9
10
use Email::Sender::Simple qw(sendmail);
use Email::MIME;
my $email = Email::MIME->create(...);
my $fail_object = sendmail($email);
my $fail_message = $fail_object->message;
my $fail_errorcode = $fail_object->code;
my $fail_failed_recipients = $fail_object->recipients;
2024-02-10T08:14:53 GwenDragonUngetestete Idee:
Code: (dl )1
2
3
4
5
6
7
8
9
10use Email::Sender::Simple qw(sendmail);
use Email::MIME;
my $email = Email::MIME->create(...);
my $fail_object = sendmail($email);
my $fail_message = $fail_object->message;
my $fail_errorcode = $fail_object->code;
my $fail_failed_recipients = $fail_object->recipients;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
failed AUTH: Authentication credentials invalid
Trace begun at /usr/local/share/perl/5.28.1/Email/Sender/Transport/SMTPS.pm line 98
Email::Sender::Transport::SMTPS::_throw('Email::Sender::Transport::SMTPS=HASH(0x559959a8a8)', 'failed AUTH', 'Net::SMTPS=GLOB(0x5599075248)') called at /usr/local/share/perl/5.28.1/Email/Sender/Transport/SMTPS.pm line 71
Email::Sender::Transport::SMTPS::_smtp_client('Email::Sender::Transport::SMTPS=HASH(0x559959a8a8)') called at /usr/local/share/perl/5.28.1/Email/Sender/Transport/SMTPS.pm line 107
Email::Sender::Transport::SMTPS::send_email('Email::Sender::Transport::SMTPS=HASH(0x559959a8a8)', 'Email::Abstract=ARRAY(0x559868d7b8)', 'HASH(0x5599495570)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45
Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 100
eval {...} at /usr/share/perl5/Try/Tiny.pm line 93
Try::Tiny::try('CODE(0x559a3b02b0)', 'Try::Tiny::Catch=REF(0x5597476278)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58
Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SMTPS=HASH(0x559959a8a8)', 'Email::Abstract=ARRAY(0x559868d7b8)', 'HASH(0x559958c930)') called at /usr/share/perl5/Email/Sender/Simple.pm line 119
Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abstract=ARRAY(0x559868d7b8)', 'HASH(0x559a24acc0)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 45
Email::Sender::Role::CommonSending::try {...} at /usr/share/perl5/Try/Tiny.pm line 100
eval {...} at /usr/share/perl5/Try/Tiny.pm line 93
Try::Tiny::try('CODE(0x5593808638)', 'Try::Tiny::Catch=REF(0x55991742f0)') called at /usr/share/perl5/Email/Sender/Role/CommonSending.pm line 58
Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Email::MIME=HASH(0x5599a752c8)', 'HASH(0x55953c91c0)') called at /usr/local/share/perl/5.28.1/Sub/Exporter/Util.pm line 18
Sub::Exporter::Util::__ANON__('Email::MIME=HASH(0x5599a752c8)', 'HASH(0x55953c91c0)') called at FHEM/99_myUtils.pm line 1358
main::SendMeterReading('CH_Watermeter_Main') called at (eval 6125160) line 1
eval '{SendMeterReading("CH_Watermeter_Main")}' at fhem.pl line 1177
main::AnalyzePerlCommand('HASH(0x55961ae148)', '{SendMeterReading("CH_Watermeter_Main")}', 1) called at fhem.pl line 1206
main::AnalyzeCommand('HASH(0x55961ae148)', '{SendMeterReading("CH_Watermeter_Main")}', 'ACC') called at fhem.pl line 1133
main::AnalyzeCommandChain('HASH(0x55961ae148)', '{SendMeterReading("CH_Watermeter_Main")}') called at FHEM/01_FHEMWEB.pm line 2863
main::FW_fC('{SendMeterReading("CH_Watermeter_Main")}', '') called at FHEM/01_FHEMWEB.pm line 1025
main::FW_answerCall('/fhem&fw_id=1708110991.06291&cmd=%7BSendMeterReading%28%22CH_Watermeter_Main%22%29%7D') called at FHEM/01_FHEMWEB.pm line 609
main::FW_Read('HASH(0x55961ae148)') called at fhem.pl line 3985
main::CallFn('WEB_::ffff:192.168.178.82_47004', 'ReadFn', 'HASH(0x55961ae148)') called at fhem.pl line 786
QuoteIf there is an error sending the message, an exception will be thrown. It will be an object belonging to the class Email::Sender::Failure.