Load auth info if possible. Load smtpmail if user provide server to use.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 07 Nov 2011 02:47:12 +0200
changeset 773 9308a0c91624
parent 772 f0a62f45a356
child 774 ebfb1eb5cf56
Load auth info if possible. Load smtpmail if user provide server to use.
.emacs
.emacs-my
--- a/.emacs	Mon Nov 07 02:25:36 2011 +0200
+++ b/.emacs	Mon Nov 07 02:47:12 2011 +0200
@@ -33,6 +33,8 @@
 
 (defvar my-autoload (concat my-lisp-dir "/autoload-my.el")
   "Path to autoload for mode files.")
+(defvar my-auth (expand-file-name "~/.emacs-auth")
+  "Path to auth info for Emacs.")
 (defvar dot-emacs-autogen (expand-file-name "~/.emacs-autogen")
   "Path to automatically generated config file. It content depend on
   installation environment and it was overridden on install.")
@@ -45,6 +47,9 @@
 (if (file-exists-p dot-emacs-autogen)
     (load dot-emacs-autogen))
 
+(if (file-exists-p my-auth)
+    (load my-auth))
+
 ;; pre-load custom settings
 (if (file-exists-p dot-emacs-pre)
     (load dot-emacs-pre))
--- a/.emacs-my	Mon Nov 07 02:25:36 2011 +0200
+++ b/.emacs-my	Mon Nov 07 02:47:12 2011 +0200
@@ -1171,12 +1171,15 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "smtp, smtpmail")
 
-(setq
- ;; If you use the default mail user agent.
- send-mail-function 'smtpmail-send-it
- ;; If you use Message or Gnus.
- message-send-mail-function 'smtpmail-send-it
-)
+(when (boundp 'smtpmail-smtp-server)
+  (require 'smtpmail)
+  (setq
+   ;; If you use the default mail user agent.
+   send-mail-function 'smtpmail-send-it
+   ;; If you use Message or Gnus.
+   message-send-mail-function 'smtpmail-send-it
+   )
+  )
 ;; (setq smtpmail-debug-verb t)
 ;; (setq smtpmail-debug-info t)