someusernamehere <[EMAIL PROTECTED]> writes: > (defun fs-change-smtp () > "Change the SMTP server according to the current from line." > (save-excursion > (let ((from > (save-restriction > (message-narrow-to-headers) > (message-fetch-field "from")))) > (message "From is `%s', setting `smtpmail-smtp-server' to `%s'" > from > (cond > ((string-match "[EMAIL PROTECTED]" from) > ;; Use stmp-auth > (message "Using smtp-auth") > ;; Sending mail > ((.................... > ....................)) > ((string-match "[EMAIL PROTECTED]" from) > ;; Use other server > (message "Using other server") > ((....................... > .......................)) > (t > (error > (concat "Don't know which mail server to use for > " > from)))))))) > > (add-hook 'message-setup-hook 'fs-change-smtp) > > For change among smtp servers depending the "from" header, but..... > what abou when I want to send News????, I want to send news with the > from [EMAIL PROTECTED], but this is not defined in the function fs- > change-smtp then I get an "Don't know which mail server to use for ", > > how I can fix this?
Replace the `error' in the function above with `message'. Then the "Dont't know..." message will still be printed, but no erros will be signalled. That's ok because for news you don't use smtp servers anyway. Oh, wait. There's a better solution. Take the function as-is, but add it to `message-send-mail-hook' instead of `message-setup-hook'. Bye, Tassilo -- My work on free software is motivated by an idealistic goal: spreading freedom and cooperation. I want to encourage free software to spread, replacing proprietary software that forbids cooperation, and thus make our society better. (Richard M. Stallman) _______________________________________________ info-gnus-english mailing list [email protected] http://lists.gnu.org/mailman/listinfo/info-gnus-english
