5 Queued delivery

If you connect to the internet via a dialup connection, or for some other reason don’t have permanent internet connection, sending mail will fail when you are not connected. The SMTP library implements queued delivery, and the following variable control its behavior.


The variable smtpmail-queue-mail controls whether a simple off line mail sender is active. This variable is a boolean, and defaults to nil (disabled). If this is non-nil, mail is not sent immediately but rather queued in the directory smtpmail-queue-dir and can be later sent manually by invoking smtpmail-send-queued-mail (typically when you connect to the internet).


Normally the queue will be dispatched with the values of the SMTP variables that are in effect when M-x smtpmail-send-queued-mail is executed, but if smtpmail-store-queue-variables is non-nil, the values for smtpmail-smtp-server (etc.) will be stored when the mail is queued, and then used when actually sending the mail. This can be useful if you have a complex outgoing mail setup.


The variable smtpmail-queue-dir specifies the name of the directory to hold queued messages. It defaults to ~/Mail/queued-mail/.

The function smtpmail-send-queued-mail can be used to send any queued mail when smtpmail-queue-mail is enabled. It is typically invoked interactively with M-x smtpmail-send-queued-mail RET when you are connected to the internet.