Gnus development mailing list
 help / color / mirror / Atom feed
From: Bob Newell <bobnewell@bobnewell.net>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: ding@gnus.org
Subject: Re: Multiple Mailings
Date: Sun, 08 Sep 2019 18:33:58 -1000	[thread overview]
Message-ID: <874l1mozpl.fsf@bobnewell.net> (raw)
In-Reply-To: <875zm2qi23.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 09 Sep 2019 11:12:20 +0800")


I see what you are doing in your code, but it didn't quite work for me
although I'm sure with some tweaking it could.

I solved the issue another way, which is hackish but at least a little
less so. The code is below; it's for my own environment, but could be
generally useful if the connectivity check were to be removed. I can't
take much credit; it's mostly stuff found on the web with a few of my
own changes.

I now get around the prompting by resetting 'message-sent-message-via to
nil, so gnus doesn't realize I'm sending duplicates and therefore
doesn't nag.

I tie 'message-send-and-exit-multiple to C-c C-m C-m in 'message-mode-map.

(defun message-send-and-exit-multiple ()
  (interactive) 
;;; Check connectivity once, assume(!) it stays up for the duration of
;;; the mass mailing.
  (if (outbound-port-test "smtp.gmail.com" 587)
      (progn
	(let ((addresses
	       (split-string
		(message-fetch-field "To")
		"," t)))
	  (while addresses
	    ;; Avoid prompts for mailing duplicate copies.
	    (setq message-sent-message-via nil)
	    (let ((address (car addresses)))
	      (setq addresses (cdr addresses))
	      (message-remove-header "To")
	      (message-add-header (format "To: %s" address))
	      (if addresses
  	        (message-send)
		(message-send-and-exit))))))
       (message "No smtp connectivity, save as draft instead")))

-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *



  reply	other threads:[~2019-09-09  4:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 19:07 Bob Newell
2019-09-09  3:12 ` Eric Abrahamsen
2019-09-09  4:33   ` Bob Newell [this message]
2019-09-09  7:48     ` Eric Abrahamsen
     [not found]     ` <87lfuxq57r.fsf@ericabrahamsen.net>
2019-09-09  7:50       ` Eric Abrahamsen
2019-09-09 20:11 ` Peter Münster
2019-09-09 21:30   ` Bob Newell
2019-09-09 21:49     ` Peter Münster

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

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

  git send-email \
    --in-reply-to=874l1mozpl.fsf@bobnewell.net \
    --to=bobnewell@bobnewell.net \
    --cc=ding@gnus.org \
    --cc=eric@ericabrahamsen.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.
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 NNTP newsgroup(s).