Thread Perl Script PGP Email entschlüsseln und weiterleiten
(18 answers)
Opened by Chris at 2017-02-17 21:26
Sorry, Nachtrag mit Email::Simple anstelle von sendmail...Problem ist aber gleich...
Code (perl): (dl
)
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 27 28 29 30 31 32 33 34 35 36 # ***NEW*** own subroutine for mail sending sub mail_it { my $mailtext = shift; my $to = 'chris@localhost'; my $from = 'root@localhost'; my $subject = 'Test Email from decrypt.pl'; my $email = Email::Simple->create( header => [ To => $to, From => $from, Subject => $subject, ], body => $mailtext, ); sendmail($email); # open( my $mailer, "|-", "/usr/sbin/sendmail -t" ) # or die "Could not open sendmail: $!"; # one print to print it all # print $mailer <<"END_OF_MESSAGE"; #To: $to #From: $from #Subject: $subject #$mailtext #END_OF_MESSAGE # close( $mailer ) or die "Close sendmail failed: $!"; # print "Email Sent Successfully\n"; } Last edited: 2017-02-18 13:47:16 +0100 (CET) |