harven <[EMAIL PROTECTED]> 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. http://www.emacswiki.org/cgi-bin/wiki/MessageMode).
> 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    "[EMAIL PROTECTED]"
>         send-mail-function   'smtpmail-send-it
>         smtpmail-smtp-server "smtp.myisp.uk")
>  
> 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 http://www.emacswiki.org/cgi-bin/wiki/CategoryBatchMode 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.

Francis



_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to