Question: I've just installed the 'mail' command in Ubuntu (mailutils package) in order to
view feedback from cron jobs.

I type 'mail' at the prompt and see something like this:

```
"/var/mail/*$USER*": 1 message 1 unread
>U 1 *Name* *Date* Output from your job 

```

I type `1` at the `?` prompt and get a lot of output about the message (From, Date, Subject...) but on the last line it says

```
Error: Can't open display:
?

```

and I'm returned to the prompt.

Does anyone have any idea what the problem might be?

Answer: 
The `mail` program opens emails in a pager. The environment variable `PAGER` can override the default pager, which is typically `less`. In Debian-based systems, there is a `/usr/bin/pager` that is managed by the alternatives system. You need to ensure that your pager is not a GUI application, which would require X. An easy way to test this is to set `PAGER` temporarily.

```
PAGER=/usr/bin/less mail

```
it looks like trying to open GUI. you can set the your DISPLAY variable to where you are running the xwindows server to open it:

```
  export DISPLAY=IP/Hostname:0.0

```

IP/Hostname=addres to your xwindows server