Question : Sending multi lines email by Linux sendemail script

Hello experts,

I am using this sendemail script to send emails from a linux server:

http://caspian.dotconf.net/menu/Software/SendEmail/

Here is the command which I am using:

# /usr/local/bin/sendEmail -f [email protected] -t [email protected] -m 'I want to write multiple lines here'

I am writing the message body in a single line after the option -m as above.

The question: How to write a multi line message here?

Answer : Sending multi lines email by Linux sendemail script

The problem is that this script isn't really known well or used widely. Only the author would be able to definitely answer the question without experimenting.
Have you tried:

# /usr/local/bin/sendEmail -f [email protected] -t [email protected] -m 'I want to write multiple lines here \nThis would be line 2'

or:

# /usr/local/bin/sendEmail -f [email protected] -t [email protected] -m 'I want to write multiple lines here \\nThis would be line 2'

If no good, you could always put your multi-line message in a file (say: messagetext), then run:

# /usr/local/bin/sendEmail -f [email protected] -t [email protected] -o message-file=messagetext


But why do you use this script and not sendmail directly?

Try this:
# mail [email protected]

you will be prompted for a subject line, then there will be a text prompt for the message. Input as many lines as you wish, then go to a new line and press CTRL + D.
You may now be prompted for a CC; either fill out or hit enter. Message should be sent under your presently logged in username.
Random Solutions  
 
programming4us programming4us