all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* batch mode to send an email
@ 2006-08-07  9:23 ken
  2006-08-07 15:23 ` Kevin Rodgers
  0 siblings, 1 reply; 8+ messages in thread
From: ken @ 2006-08-07  9:23 UTC (permalink / raw)


Trying to get emacs to send an email.  I've heard other people have
gotten this to work and have even been using it.  So I'm hoping I won't
have to upgrade anything to accomplish this.

I've read a lot of documentation on sending email with emacs.  But what
has been hinted at there hasn't yet worked for me (in many years).
(Yeah, I used to use gnus, but switched long ago... another story,
irrelevant here.)

To eliminate the possibility of misconfiguration in ~/.emacs, I'm
calling the elisp file from a tiny bash script.  I.e., if the
documentation on using emacs in batch mode is correct, ~/.emacs is not
read when emacs is called in batch mode.

To lower the bar for emacs as far as possible, at this point in
development I'm only asking the elisp script to send something--
anything at all, even garbage-- to port 25 on a server we'll call
mail.server.tld.  That is, at this point it doesn't have to (though it
may and eventually must) specify a local user, a destination email
address, subject line and other headers, body of the email.  In order to
eliminate as much as possible any misconfiguration which would cause the
entire elisp script not to work, at this point I'm only trying to get
emacs to do the very first, very smallest step in sending an email in
batch mode.  If emacs needs to do more than this in order to function at
all, that's fine.  I'm just trying to keep things as absolutely simple
as possible.  I'll be delighted if emacs does something that even
remotely looks like sending an email.


Thanks very much for your assistance.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send an email
  2006-08-07  9:23 batch mode to send an email ken
@ 2006-08-07 15:23 ` Kevin Rodgers
  2006-08-07 19:07   ` ken
                     ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kevin Rodgers @ 2006-08-07 15:23 UTC (permalink / raw)


ken wrote:
> Trying to get emacs to send an email.  I've heard other people have
> gotten this to work and have even been using it.  So I'm hoping I won't
> have to upgrade anything to accomplish this.
> 
> I've read a lot of documentation on sending email with emacs.  But what
> has been hinted at there hasn't yet worked for me (in many years).
> (Yeah, I used to use gnus, but switched long ago... another story,
> irrelevant here.)
> 
> To eliminate the possibility of misconfiguration in ~/.emacs, I'm
> calling the elisp file from a tiny bash script.  I.e., if the
> documentation on using emacs in batch mode is correct, ~/.emacs is not
> read when emacs is called in batch mode.

That is correct.

> To lower the bar for emacs as far as possible, at this point in
> development I'm only asking the elisp script to send something--
> anything at all, even garbage-- to port 25 on a server we'll call
> mail.server.tld.  That is, at this point it doesn't have to (though it
> may and eventually must) specify a local user, a destination email
> address, subject line and other headers, body of the email.  In order to
> eliminate as much as possible any misconfiguration which would cause the
> entire elisp script not to work, at this point I'm only trying to get
> emacs to do the very first, very smallest step in sending an email in
> batch mode.  If emacs needs to do more than this in order to function at
> all, that's fine.  I'm just trying to keep things as absolutely simple
> as possible.  I'll be delighted if emacs does something that even
> remotely looks like sending an email.

(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)

-- 
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send an email
  2006-08-07 15:23 ` Kevin Rodgers
@ 2006-08-07 19:07   ` ken
  2006-08-07 23:25     ` Kevin Rodgers
  2006-08-07 23:51   ` ken
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: ken @ 2006-08-07 19:07 UTC (permalink / raw)


Kevin Rodgers wrote:
> ken wrote:
>> Trying to get emacs to send an email.  I've heard other people have
>> gotten this to work and have even been using it.  So I'm hoping I won't
>> have to upgrade anything to accomplish this.
>>
>> I've read a lot of documentation on sending email with emacs.  But what
>> has been hinted at there hasn't yet worked for me (in many years).
>> (Yeah, I used to use gnus, but switched long ago... another story,
>> irrelevant here.)
>>
>> To eliminate the possibility of misconfiguration in ~/.emacs, I'm
>> calling the elisp file from a tiny bash script.  I.e., if the
>> documentation on using emacs in batch mode is correct, ~/.emacs is not
>> read when emacs is called in batch mode.
> 
> That is correct.
> 
>> To lower the bar for emacs as far as possible, at this point in
>> development I'm only asking the elisp script to send something--
>> anything at all, even garbage-- to port 25 on a server we'll call
>> mail.server.tld.  That is, at this point it doesn't have to (though it
>> may and eventually must) specify a local user, a destination email
>> address, subject line and other headers, body of the email.  In order to
>> eliminate as much as possible any misconfiguration which would cause the
>> entire elisp script not to work, at this point I'm only trying to get
>> emacs to do the very first, very smallest step in sending an email in
>> batch mode.  If emacs needs to do more than this in order to function at
>> all, that's fine.  I'm just trying to keep things as absolutely simple
>> as possible.  I'll be delighted if emacs does something that even
>> remotely looks like sending an email.
> 
> (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)
> 

Kevin,

Thanks very much for your reply.  But it didn't work.  All I did was
change the destination email address and the mail server to actual,
existing values.

The error I got was:

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 commented out ''(mail nil ....)'' and the error went away.

"C-h f mail" says there can be more args, but doesn't say it must.  I'm
not certain how to fix this line.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send an email
  2006-08-07 19:07   ` ken
@ 2006-08-07 23:25     ` Kevin Rodgers
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2006-08-07 23:25 UTC (permalink / raw)


ken wrote:
> Kevin Rodgers wrote:
>> 
>> (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)
>>
> 
> Kevin,
> 
> Thanks very much for your reply.  But it didn't work.  All I did was
> change the destination email address and the mail server to actual,
> existing values.
> 
> The error I got was:
> 
> 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 commented out ''(mail nil ....)'' and the error went away.
> 
> "C-h f mail" says there can be more args, but doesn't say it must.  I'm
> not certain how to fix this line.

Mail accepts anywhere between 0 and 7 arguments:

(mail &optional noerase to subject in-reply-to cc replybuffer actions)

The call above passes 3, so I can't imagine why it is complaining.

-- 
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send an email
  2006-08-07 15:23 ` Kevin Rodgers
  2006-08-07 19:07   ` ken
@ 2006-08-07 23:51   ` ken
  2006-08-08 12:21   ` batch mode to send email; bug in "mail" ken
  2006-08-08 12:37   ` ken
  3 siblings, 0 replies; 8+ messages in thread
From: ken @ 2006-08-07 23:51 UTC (permalink / raw)



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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send email; bug in "mail"
  2006-08-07 15:23 ` Kevin Rodgers
  2006-08-07 19:07   ` ken
  2006-08-07 23:51   ` ken
@ 2006-08-08 12:21   ` ken
  2006-08-08 12:37   ` ken
  3 siblings, 0 replies; 8+ messages in thread
From: ken @ 2006-08-08 12:21 UTC (permalink / raw)



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-goal: Trying to send Mail with elisp\n")

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

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

(mail-send-and-exit)


The error I get is with the third line-- "(mail nil ...)":

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

(Error is 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send email; bug in "mail"
  2006-08-07 15:23 ` Kevin Rodgers
                     ` (2 preceding siblings ...)
  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
  3 siblings, 1 reply; 8+ messages in thread
From: ken @ 2006-08-08 12:37 UTC (permalink / raw)



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-goal: Trying to send Mail with elisp\n")

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

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

(mail-send-and-exit)


The error I get is with the third line-- "(mail nil ...)":

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

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

Note that there's no error when I put the point after the line in
question and do "C-x C-e" but only within an .el file executed from bash.

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: batch mode to send email; bug in "mail"
  2006-08-08 12:37   ` ken
@ 2006-08-08 13:13     ` Nick Roberts
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Roberts @ 2006-08-08 13:13 UTC (permalink / raw)
  Cc: emacs-bug

 > The error I get is with the third line-- "(mail nil ...)":
 > 
 > 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

You need to change:

(defun mail-send-and-exit (arg)
...

in sendmail.el to

(defun mail-send-and-exit (&optional arg)
...

This has been done in CVS Emacs.  It would help us if you tested this
version which you can get from Savannah with

 
 cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs

and by following the instructions in the file INSTALL.CVS.

bug-gnu-emacs@gnu.org is the mailing list for reporting bugs for the released
version of Emacs.  You can send to that list using report-emacs-bug (also
on the menu bar under "Help"). It also gives your configuration.


-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-08 13:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07  9:23 batch mode to send an email ken
2006-08-07 15:23 ` Kevin Rodgers
2006-08-07 19:07   ` ken
2006-08-07 23:25     ` Kevin Rodgers
2006-08-07 23:51   ` ken
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.