E
E
Evgeny Elizarov2010-12-21 12:07:06
linux
Evgeny Elizarov, 2010-12-21 12:07:06

How to specify the title and body of the letter when sending a letter from the console?

Postfix is ​​installed on the server, it is necessary to send a message from the console, I do this:

sendmail -F "from console" [email protected]

But in fact, he is waiting for the input of the body of the letter, which does not suit me, how would he immediately transfer the body of the letter and the message title ?! I read something and did not meet the necessary keys.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DevMan, 2010-12-21
@KorP

#!/bin/bash

subject="test subject"
email_to="[email protected]"
message="test message"

echo "${message}" | /usr/bin/mail -s "${subject}" "${email_to}"

Z
Zazza, 2010-12-21
@Zazza

mail -s <subject> <address>
mail
CTRL+D

S
SovGVD, 2010-12-21
@SovGVD

how to shove another investment right away =)

I
Igor Gorshal, 2016-05-14
@neegor

echo 'Message text' | mail -s 'Subject' [email protected]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question