unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ken <gebser@speakeasy.net>
Subject: Re: batch mode to send an email
Date: Mon, 07 Aug 2006 19:51:28 -0400	[thread overview]
Message-ID: <44D7D200.4020900@speakeasy.net> (raw)
In-Reply-To: <eb7luk$ffv$1@sea.gmane.org>


Trying to get emacs to send an email in batch mode.
Using this code:

(setq send-mail-function 'smtpmail-send-it
      smtpmail-smtp-server "mail.server.tld")

(setq mail-default-headers
      "X-RTFM: Sending Mail; Mail Sending; (smtpmail)Emacs Speaks SMTP\n")

(mail nil "someuser@somewhere.somedomain" "my favorite subject")

(insert "Blah, blah, blah.\n")

(mail-send-and-exit)


The error I get is:

Wrong number of arguments: #[(arg)
("/usr/share/emacs/21.3/lisp/mail/sendmail.elc" . 21146) nil 2
("/usr/share/emacs/21.3/lisp/mail/sendmail.elc" . 20985) "P"], 0

(all on one line, of course.  My mail client autowraps.)

I comment out  the line ''(mail nil ....)'' and the error goes away.

"C-h f mail" says there can be more args, but doesn't say it must.

       reply	other threads:[~2006-08-07 23:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <44D7069F.7010105@speakeasy.net>
     [not found] ` <eb7luk$ffv$1@sea.gmane.org>
2006-08-07 23:51   ` ken [this message]
2006-08-08 12:21   ` batch mode to send email; bug in "mail" ken
2006-08-08 12:37   ` ken
2006-08-08 13:13     ` Nick Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44D7D200.4020900@speakeasy.net \
    --to=gebser@speakeasy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).