Search code examples
emailterminalmutt

How can I quickly bulk-send files to an email?


I regularly send files in Gmail to exchange files between different computers. It is cumbersome. I want quickly to send my files, such as error logs. I found a promising article [1] about Mutt, but it apparently is not what I want:

Please note that mutt is a pure MUA and cannot send e-mail without proper email server .

I want no email server, since I cannot install it to my clients' computers. I don't need to know the sender. I want quickly to send many error logs to my Gmail. I am looking something like:

mutt -s "Many error logs" -a ./log1 -a ./log2 -a ./log3 [email protected]

I would really love to do the job in terminal. It is too time-consuming to bulk-send files in Gmail. How can I quickly send a great amount of files?

[1] http://www.cyberciti.biz/tips/sending-mail-with-attachment.html


Solution

  • Mutt can be configured to use a different MTA than the default sendmail. You could install SSMTP (described here and available for download here) or ESMTP and configure it to send directly to Gmail's web server, then configure Mutt to use SSMTP or ESMTP. This is nicely described in this Ubuntu tutorial. If installing systemwide binaries isn't an option, you ought to be able to install SSMTP or ESMTP to a local folder.

    If you prefer scripting, mimesend, which is one of the example programs in Perl's MIME-tools package, does the same thing as your mutt command and could be hacked to connect to Gmail's web server.