Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] Mail mit Attachment von Script aus versenden
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
fuchsmi
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2003
Posts: 118

PostPosted: Sun Apr 25, 2004 5:47 pm    Post subject: [OT] Mail mit Attachment von Script aus versenden Reply with quote

Hallo!
ich würde gerne per Script eine Mail mit einem .jpg als Attachment verschicken.
Kennt jemand ein einfaches Tool?

Michi
Back to top
View user's profile Send private message
ruth
Retired Dev
Retired Dev


Joined: 07 Sep 2003
Posts: 640
Location: M / AN / BY / GER

PostPosted: Sun Apr 25, 2004 6:50 pm    Post subject: Reply with quote

hi,
ich nehme an, du willst perl verwenden:
da gibts z.b. sowas:
Code:

use MIME::Lite;

my $mime_msg = MIME::Lite->new(
   From => $from_address,
   To   => $to_address,
   Subject => $subject,
   Type => $mime_type,
   Data => $message
   )
  or die "Error creating MIME body: $!\n";

my $filename = '/tmp/dateiname.zip';
my $recommended_filename = 'better_filename.zip';

# Attach the test file
$mime_msg->attach(
   Type => 'application/zip',
   Path => $filename,
   Filename => $recommended_filename
   )
  or die "Error attaching test file: $!\n";

weiteres hierzu über perldoc MIME::Lite

das übrige senden und verarbeiten sollte nach perl standard gehen;
also z.b. über den sendmail-wrapper.
du kannst, wenn du willst, natürlich auch auf
Code:

use Net::SMTP;

zurückgreifen.
wieder siehe perldoc Net::SMTP

so, hoffe, geholfen zu haben + schönen abend noch
gruss
rootshell
_________________
"The compiler has tried twice to abort and cannot do so; therefore, compilation will now terminate."
-- IBM PL/I (F) error manual
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum