J provides support for IMAP, POP and SMTP. (By coincidence, it's also possible to use the openMailbox command to open a read-only view of a Unix mbox-style mailbox, but that's not officially sanctioned yet.)

To set up mail, you need to add a few lines to your preferences file:

    enableExperimentalFeatures = true
    enableMail = true

    # Default "From" address information.
    userFullName = Peter Graves
    userMailAddress =

    # The SMTP server to be used for sending mail.
    smtp = annie
(Your name, mail address and SMTP server may be different. On a Unix system, setting smtp to "localhost" might work.)

You might also want to specify a default mailbox for the inbox command:
    inbox = {peter@annie}inbox
You can also get j to send automatic blind copies of outgoing messages:
    bcc =
To read mail, use the openMailbox command. For IMAP, mailbox URLs should look like this:
For example:
For POP, mailbox URLs should look like this:
For example:
Once you're in your mailbox, you can use mailboxReadMessage, mapped by default to Enter, to read the message at the current location of the caret.

To compose mail, use the compose command. You can also use messageReplyToSender or messageReplyToGroup to reply to a message you're reading.

In a message composition buffer, the header lines at the top of the buffer will be sent verbatim with your message, with the exception of lines listing attachments. You can edit the default header lines or add additional ones. You should leave the message separator line ("--text follows this line--") alone; j uses it to mark the end of the message headers, and it will be removed automatically before the message is actually sent.

Automatic word wrap is on by default in mail composition buffers (except for the header lines). You can use toggleWrap to turn it off. By default, wrapCol is 72 in mail composition buffers. To change this, add a line like this to your preferences file:
    SendMailMode.wrapCol = 80
You can use the command attachFile to attach one or more files to your outgoing message.

When you're ready, use the send command to send your message.

By default, j never deletes any messages in your POP mailbox on the server. You can configure j to delete messages on the server after they have been successfully retrieved by adding this line to your preferences file:
    popKeepMessagesOnServer = false
If you prefer, you can configure j to keep messages on the server when they are first retrieved, but delete them on the server when you have deleted and expunged them locally. To do so, add these two lines to your preferences file:
    popKeepMessagesOnServer = true
    popExpungeDeletedMessagesOnServer = true
The popKeepMessagesOnServer and popExpungeDeletedMessagesOnServer properties only apply to POP mailboxes.

Until you invoke mailboxExpunge, you can use the command mailboxUndelete to undelete any message that is marked for deletion. This applies to both POP and IMAP mailboxes.

The following commands are specifically relevant to mail: