Rahul Gupta
Rahul Gupta

Reputation: 63

How to send a png file embedded in a mail via command line on linux?

I was trying to send a png file in a body of an email via command line. I have been using the following command:

uuencode file.png file.png| mail [email protected]

but it attaches the file in the mail, rather than embedding it in body. Could you please tell me how to send mail with png file embedded in mail ?

Thanks.

Upvotes: 6

Views: 9183

Answers (1)

Bigfootmech
Bigfootmech

Reputation: 31

You want to create a mime HTML email a la:

How to embed images in email

Then take the headers (all the lines before the first boundary), remove them from that input and add them individually with the -a command after mail such as:

https://stackoverflow.com/a/12262421/2244213

Upvotes: 2

Related Questions