On 2009-01-30 09:27 (-0600), Ted Zlatanov wrote:

> I think you want mail-extract-address-components.  It returns a list of
> name-address pairs.  You know how to get the whole To: and Cc: lines, I
> assume.

Thanks! So to answer my original question, below is a code which returns
a list consisting strings of email addresses: ("per...@somewhere"
"someonee...@invalid" "u...@isp.invalid"). The address list is
constructed from To and Cc fields.


(save-excursion
  (goto-char (point-min))
  (let (recipients
        (to-lst
         (mail-extract-address-components
          (or (cdr (assoc 'to (mail-header-extract-no-properties))) "")
          'all))
        (cc-lst
         (mail-extract-address-components
          (or (cdr (assoc 'cc (mail-header-extract-no-properties))) "")
          'all)))
    (dolist (item (append to-lst cc-lst) recipients)
      (add-to-list 'recipients
                   (nth 1 item)))))
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to