1

I'm sending myself a mail like this:

AdministorsMBP2:~ administrator$ mail -s "subject here" me@mydomain.com <<< "message"
AdministorsMBP2:~ administrator$ echo $?
0

The command returns zero, meaning success. mailq command says empty. my gmail inbox is empty too.

so what happened? did the mail go through , if not how I trace this.

mail command borrowed from: https://stackoverflow.com/a/13447901

  • Basically - you’ll need to enter the credentials needed to send. What steps did you take? I’ll add an answer with three ways to enter your sending credentials, but the first thing to check is that the internet mail relay you are sending to accepts your IP address and/or your credentials. – bmike Dec 22 '19 at 19:59

1 Answers1

1

I know you want to use the command line, but use the GUI to add one mail account in Apple mail so you can view the sending mail server status. This completes the setup and saves your sending credentials so mail can use them to log in and send the mail.

Send one mail using the official mail app, then try again from the command line.

If you still get errors from the command line, use the connection doctor to check the results of the sending mail server status. All green lights indicate success - show the logs if you have red or orange lights on the status.

Here are relevant threads if you want to do things the harder, longer way. The first has great test commands and the second sidesteps the native system and installs new versions of mail/sendmail.

The second link installs a complete sendmail package and avoids using the one that comes with the system, thus avoiding it altogether.

Allan
  • 101,432
bmike
  • 235,889