About mail

hi
I am trying to send mail from terminal in linux, but i didn't success
when i check the email, there is not new email from this.

echo "Message Body Here" | mail -s "Subject Here" someuser@gmail.com

what's wrong?
thanks in advance

Maybe the reason is that the option "receive mail from untrusted sources" is not enabled on Google?

If you review the Linux man page for mail ,

mail(1) [linux man page]

you will see you can set the debugging level:

       
        --debug-level=LEVEL
	      set Mailutils debugging level

       --[no-]debug-line-info show source info with debugging messages

and if you Google for "Mailutils debugging level" you will have more information on the different ways to set up debugging, for example, see:

https://mailutils.org/manual/html_node/Logging-and-Debugging.html

Example info on logging and debugging (check to make sure it matches your system)

3.9.1.3 Logging and debugging
The default behavior of sieve is to remain silent about anything except errors. However, it is sometimes necessary to see which actions are executed and on which messages. This is particularly useful when debugging the sieve scripts. The --verbose (-v) option outputs log of every action executed.

Option --debug allows to produce even more detailed debugging information. This option takes an argument specifying the debugging level to be enabled. The argument can consist of the following letters:

�t'
This flag enables sieve tracing. It means that every test will be logged when executed.

�T'
This flag enables debugging of underlying mailutils library.

�P'
Trace network protocols: produces log of network transactions executed while running the script.

�g'
Enable main parser traces. This is useful for debugging the sieve grammar.

�i'
Trace the program instructions. It is the most extensive debugging level. It produces the full execution log of a sieve program, showing each instruction and states of the sieve machine. It is only useful for debugging the code generator.

Note, that there should be no whitespace between the short variant of the option (-d), and its argument. Similarly, when using long option (--debug), its argument must be preceded by equal sign.

The first place I would look is where you mail would be passed to if it is not for a local account (i.e. on the server sending it)

You will be looking for a mail relay, but it depends what OS & version you are using as to where that is coded. It might be in /etc/sendmail.cf (or similar) or under /etc/postfix somewhere.

Can you show us what OS & version you have. We can then help check that your mail service configuration meets your needs.

Is there anything still in the mail queue? Run mailq as the superuser account
Is there any mail in the inbox of the account trying to send it (i.e. has it failed & been returned)

Kind regards,
Robin