Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mailing images using a bash script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
vert
Apprentice
Apprentice


Joined: 07 May 2002
Posts: 214
Location: Delft, The Netherlands

PostPosted: Tue Jan 14, 2003 9:05 pm    Post subject: Mailing images using a bash script Reply with quote

I've set up several scripts on my system that mail me different things of interest everyday (such as portage updates :wink: ). This is all done in standard bash. But how can I include pictures (or other binary files) in the mails the bash scripts create? I think it can be done with MIME in some way or something like uuencode. Anybody know how to do this? Thnx!
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Tue Jan 14, 2003 9:15 pm    Post subject: Reply with quote

have a closer look at mpack:
Code:
emerge net-mail/mpack


cheers

SteveB
Back to top
View user's profile Send private message
DamnDirtyApe
n00b
n00b


Joined: 08 Jan 2003
Posts: 38
Location: Prince George, British Columbia, Canada

PostPosted: Tue Jan 14, 2003 11:38 pm    Post subject: Perl? (MIME::Lite) Reply with quote

If you're willing to veer away from shell scripting, Perl's MIME::Lite module (http://search.cpan.org/author/ERYQ/MIME-Lite-2.117/lib/MIME/Lite.pm) does an excellent job of such things.
Back to top
View user's profile Send private message
vert
Apprentice
Apprentice


Joined: 07 May 2002
Posts: 214
Location: Delft, The Netherlands

PostPosted: Wed Jan 15, 2003 7:51 am    Post subject: Reply with quote

Well, I toyed with the idea of starting with perl or python or something like that, but I haven't gotten around to that. Would you say that learning such a language is worth the effort for such simple things as scripts for notification mails and simple maintenance (backup for example)? By the way, I got it working with mpack. So I'm happy for the moment :D
Back to top
View user's profile Send private message
DamnDirtyApe
n00b
n00b


Joined: 08 Jan 2003
Posts: 38
Location: Prince George, British Columbia, Canada

PostPosted: Wed Jan 15, 2003 4:05 pm    Post subject: Reply with quote

vert wrote:
Would you say that learning such a language is worth the effort for such simple things as scripts for notification mails and simple maintenance (backup for example)?


Absolutely.

Perl has many, many practical applications, not the least of which is sending mail. By having a basic understanding of Perl (and CPAN), you'll have a much easier time with many of the things you do already, and a far better starting point if you ever want to, say, integrate your mailer program with a web application. ;-)

If you're looking for a starting point, I highly recommend PerlMonks (http://www.perlmonks.org/).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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