[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Elisp help needed

From: Tassilo Horn
Subject: Elisp help needed
Date: Wed, 26 Nov 2003 23:59:10 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)


I need some help with Elisp. I want to configure Gnus to my needs and
therefore wrote an Elisp function which should fetch the From-line of
mails I wanna send. With the From-line it should decide which
smtp-server the mail should be send through.
My code is:

(defun fs-change-smtp ()
  "Change the SMTP server according to the current from line."
    (let ((from
             (message-fetch-field "from"))))
       ((string-match from "")
        (setq smtpmail-smtp-server ""))
       ((string-match from "")
        (setq smtpmail-smtp-server ""))
       ((string-match from "")
        (setq smtpmail-smtp-server ""))
        (setq smtpmail-smtp-server ""))))))
(add-hook 'message-send-hook 'fs-change-smtp)

But this doesn't work correctly. Always the default of the cond is
taken, even the From-line is another mail address (gmx or freenet). So I
think that the variable from has the wrong content.

Does anybody find the bug?
Or does anyone have another solution for my problem?

Much thanks in advance,

"I dunno - the guy who wrote the mouse driver in Windows systems was a
 genius. Ever noticed that the mouse can still work when the whole OS
 has crashed in a screaming heap?" - John Wiltshire

reply via email to

[Prev in Thread] Current Thread [Next in Thread]