Comment

Comment by olivertaylor

You can also do this with the system's built-in mail program. I set this up for doing bulk emails a while ago and it has proved very useful and versatile.

    (defun compose-mail-macos (&optional to subject body)
      "Compose a message using macOS's default mail program."
      (interactive)
      (start-process "Open Mail Message" nil "open"
                     (concat "mailto:"
                             (when to to) "?"
                             (when subject (concat "&subject=" (url-hexify-string subject)))
                             (when body (concat "&body=" (url-hexify-string body))))))
    
    (defun compose-mail-macos-multiple (list subject body)
      "ADDRESSES should be a list of email addresses in the form of:
    (setq mail-list '(\"Mail 1 <[email protected]>\"
                      \"Mail 2 <[email protected]>\"
                      \"Mail 3 <[email protected]>\"))"
      (while list
        (let ((to (car list)))
          (compose-mail-macos to subject body)
          (setq list (cdr list)))))

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton