I needed to test whether mail relaying worked with Exim or not. To do so I used this command:
exim -v firstname.lastname@example.org
After this type in your mail contents as shown below and hit
CTRL+D afterwards to send it:
From:email@example.com Subject: Hello From the CLI This is a test from the CLI
It’s also possible to use a one-liner:
echo -e "From:firstname.lastname@example.org\nSubject: Hello From the CLI\nThis is a test from the CLI" | exim -v email@example.com
You’ll see the raw output appear on screen, and should see a 250 status code near the end if all went well.