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

1
  • 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

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.

4
  • I don't use apple mail, its not configured. is the Gui mail needed for the terminal.app mail utilities Dec 22 '19 at 18:26
  • That’s your problem, configure it to set the outgoing email client. @american-ninja-warrior You don’t have to ever use it, just complete the outgoing mail setup.
    – bmike
    Dec 22 '19 at 18:26
  • but this is local to local mail (unix like) Dec 22 '19 at 18:27
  • I know @american-ninja-warrior. Use the GUI to setup is my advice since it’s super easy and quick. Your mail is queued locally, once you set up the system, they will send
    – bmike
    Dec 22 '19 at 18:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .