From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: batch mode to send an email Date: Mon, 07 Aug 2006 09:23:31 -0600 Organization: IHS Message-ID: References: <44D7069F.7010105@speakeasy.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1154964332 16179 80.91.229.2 (7 Aug 2006 15:25:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2006 15:25:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 07 17:25:30 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GA6yP-0000Yd-2M for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Aug 2006 17:24:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GA6yO-0006hZ-F4 for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Aug 2006 11:24:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GA6y9-0006hJ-EQ for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 11:24:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GA6y6-0006gu-PK for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 11:24:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GA6y6-0006gq-Me for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 11:24:38 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GA72M-0006pm-OX for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 11:29:03 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GA6xn-0000Pq-N7 for help-gnu-emacs@gnu.org; Mon, 07 Aug 2006 17:24:19 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Aug 2006 17:24:19 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Aug 2006 17:24:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: <44D7069F.7010105@speakeasy.net> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:36555 Archived-At: 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