help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How do I set up rmail


From: Ehud Karni
Subject: Re: How do I set up rmail
Date: Wed, 2 Apr 2003 22:49:35 +0300

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02 Apr 2003 17:06:57 +0100, Mikey <afs016@safslg4a.bangor.ac.uk> wrote:
> 
> I am trying to use emacs as a mail client.
> 
> How do I point it to my mail server?

You don't give much information, but assuming you are referring to an
ISP with pop (reading) and smtp (sending), Add these to your .emacs:

;; General function for reading pop mail:

(defun rmail-get-new-mail-from-pop (pop-host pop-user pop-pass)
  "Get mail from pop server into current rmail file
Accepts 3 parameters (strings):
    POP-HOST - host name of pop server
    POP-USER - login name of mail user
    POP-PASS - password of mail account"
  (interactive "sPOP host name: \nsUser name: \nsMail password: ")
       (let ((sv-host (getenv "MAILHOST"))
             (sv-p-inbox rmail-primary-inbox-list)
             (sv-pass rmail-pop-password)
             (rmail-pop-password-required (not (null pop-pass)))
            )
           (setq rmail-primary-inbox-list (list (concat "po:" pop-user)))
           (rmail-set-pop-password pop-pass)
           (setenv "MAILHOST" pop-host)            ;; pop host name
           (rmail)                                 ;; get mail from pop (rmail)
           (setq rmail-primary-inbox-list sv-p-inbox)
           (setq rmail-pop-password sv-pass)
           (setenv "MAILHOST" sv-host)))           ;; restore host name

;; define specific function for each mail (pop) server

(defun mail-pop-server-1 () "pop mail from account1@server.com"
  (interactive)
       (require 'rmail)                            ;; must have rmail
       (rmail-get-new-mail-from-pop
           "pop.server.internet.name" "user" "password"))  
;; of course rename it to something more meaningful (for you) 
;; and put the real values for server, ser and password.

;; To read the mail do M-x mail-pop-server-1 (or assign it to a key).


;; Sending mail (by using smtpmail)

(load-library "smtpmail")

(setq mail-default-reply-to "your.email.address")  ;; set 
(setq mail-signature-file "~/mail-signature-file") ;; to 
(setq mail-signature t)                            ;; your                
(setq mail-personal-alias-file "~/.mailrc")        ;; preferences
(setq mail-aliases t)                              ;;        
(setq mail-yank-prefix "> ")                       ;;        

(setq user-full-name "First Last")
(setq user-mail-address "your.email.address")
(setq smtpmail-default-smtp-server "your.smtp.server")         
(setq smtpmail-smtp-server smtpmail-default-smtp-server)
(setq smtpmail-local-domain nil)
(setq send-mail-function 'smtpmail-send-it)
(setq smtpmail-debug-info t)       ;;smtpmail debug in *Messages*
(setq mail-interactive 'wait)

;; Check the help for each variable and function used above !

> Do I need to have a .mail file setup?
> 
> What should I put in the file?

For Emacs you do not need anything more.

Ehud.


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+iz7PLFvTvpjqOY0RAvzSAJ45qz+V0DPI7M2WMPveiVJLe+3duQCfRf0l
13Ho958EvoOrmWVfUPY6gFo=
=SpBg
-----END PGP SIGNATURE-----




reply via email to

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