[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My first article with Gnus, eventually...

From: Francis Moreau
Subject: Re: My first article with Gnus, eventually...
Date: Fri, 17 Oct 2008 18:09:09 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

harven <> writes:

>> Hmm, I don't think that answers the question. I wnat to send a message
>> from a shell. Emacs is not started.
> You can put the following in your .emacs
>   (defun my-mail ()
>     (interactive)
>     (let ((address (read-from-minibuffer "Address: "))
>           (subject (read-from-minibuffer "Subject: "))
>           (text    (read-from-minibuffer "Text: "   )))
>       (mail 'new address subject)
>       (insert text)
>       (mail-send-and-exit)))
> Then call it from the command-line with emacs in batch mode
>   emacs -Q --no-site-file -batch -l ~/.emacs -f my-mail 2>/dev/null
> You will be prompted for an address, a subject and a text for your mail.
> emacs will then send it and quit. Note that gnus is not used here,
> emacs will use the method specified in your .emacs to send the mail
> (see e.g.
> Note also that this will read your .emacs, which may or may not be 
> what you want.
> If you don't want to actually parse your .emacs, put in some file, 
> say ~/.my-mail, the previous function and the method you want to use 
> to send mail, e.g.
>   (setq user-full-name       "me myself and I"
>         user-mail-address    ""
>         send-mail-function   'smtpmail-send-it
>         smtpmail-smtp-server "")
> Don't forget to execute the my-mail function at the end of the file
>   (my-mail)
> From the command line, you can now use
>   emacs --no-site-file -batch -l ~/.my-mail
> You can also put the following at the very start of the .my-mail file
>     #!/usr/bin/emacs --script    
> then just call it from the command line by typing .my-mail. 
> See for more detail

well actually it's much more simple to just configure and use
mail(1) for sending emails from the shell prompt.

Emails won't get archived in the Gnus archive but it doesn't matter
for such emails.

Sorry for the noise, and thanks for your suggestion.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]