The Santino

hCard
photo

Readers via RSS

Calendar

August 2010
L M M G V S D
«November
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

Service

Archives

Categories

Send emails with attachments from command line

These days I have addressed the issue relating to 'send files attached to mail through scripts (I needed a fast system to replicate backup archives).

The program I chose is mime-construct, which allows to encode the file to attach to 'the same email and sending mail to the address designated.

In its syntax linear mime-construct can be used in this way:

  $ Mime-construct - to email@dominio.qualcosa - subject soggetto_dell_email - file-attach / path / to / file 

This syntax requires that the subject should be a 'single string and that the name of the attachment is made to match the file name.

For all possible options, rather than the manual page, I recommend using the 'options-help Program.

Socialize this article:
  • del.icio.us
  • Facebook
  • SphereIt
  • Print
  • email
  • PDF
ninth

5 comments to send emails with attachments from command line

  • Giako

    Hello Paul is a beautiful article! know how many times I've. I finally solved with mutt, but often I need to send email via shell script.

    Thanks!

    PS: Did you think to put your blog in blogger? might be a good way to get more visibility, since your blog deserves.

  • I thank you for the feedback and suggestion, I followed promptly!

  • Thank you straight!

  • sandro

    I installed the program but when I launch the command to send the email program does not give me feedback and does not send anything ...

    But it should be configured in any way? He needs to work for something?

  • well ... at least one SMTP server to send mail we get it. I think the bare minimum can be configured to use exim smarthost.

Leave a Reply

You can use HTML tags These

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>