unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to send a mail using smtp?
@ 2004-12-19  9:11 Jack
  2004-12-19 12:29 ` Daniel Pittman
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jack @ 2004-12-19  9:11 UTC (permalink / raw)


Hi, everybody

Can you tell me how to config my emacs to send mail by using smtp?

regards
Jack

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19  9:11 How to send a mail using smtp? Jack
@ 2004-12-19 12:29 ` Daniel Pittman
  2004-12-19 13:08 ` D P Schreber
       [not found] ` <mailman.7260.1103461994.27204.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 19+ messages in thread
From: Daniel Pittman @ 2004-12-19 12:29 UTC (permalink / raw)


On 19 Dec 2004, Jack@mail.org wrote:
> Can you tell me how to config my emacs to send mail by using smtp?

That isn't generally the best plan, since using the local sendmail will
(usually) still put things in the queue even if the server is down.

Anyway, look at the `smtpmail' package, which has help on hooking it
into whatever mail client you use -- or tell us which one and you might
get more detailed advice.

Regards,
        Daniel
-- 
There's no sense in being precise when you don't 
even know what you're talking about.
        -- John von Neumann

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19  9:11 How to send a mail using smtp? Jack
  2004-12-19 12:29 ` Daniel Pittman
@ 2004-12-19 13:08 ` D P Schreber
  2004-12-19 13:43   ` Jack
       [not found] ` <mailman.7260.1103461994.27204.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 19+ messages in thread
From: D P Schreber @ 2004-12-19 13:08 UTC (permalink / raw)


On 2004-12-19, Jack@mail.org <Jack@mail.org> wrote:
> Can you tell me how to config my emacs to send mail by using smtp?

You mean by using a remote smtp server?  The following works for me:


(setq send-mail-function                'smtpmail-send-it
      message-send-mail-function        'smtpmail-send-it
      smtpmail-default-smtp-server      "your.smtp.server.here"
      smtpmail-smtp-service             "smtp"
      sendmail-program                  "MAIL_NOT_SENT"
      smtpmail-debug-info               nil)

(load-library "smtpmail")



where you would of course replace "your.smtp.server.here" with the name of
your actual smtp server.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 13:08 ` D P Schreber
@ 2004-12-19 13:43   ` Jack
  2004-12-19 14:43     ` D P Schreber
  0 siblings, 1 reply; 19+ messages in thread
From: Jack @ 2004-12-19 13:43 UTC (permalink / raw)


D P Schreber <schreberdp@rayban.net> writes:

> On 2004-12-19, Jack@mail.org <Jack@mail.org> wrote:
> > Can you tell me how to config my emacs to send mail by using smtp?
> 
> You mean by using a remote smtp server?  The following works for me:
> 
> 
> (setq send-mail-function                'smtpmail-send-it
>       message-send-mail-function        'smtpmail-send-it
>       smtpmail-default-smtp-server      "your.smtp.server.here"
>       smtpmail-smtp-service             "smtp"
>       sendmail-program                  "MAIL_NOT_SENT"
>       smtpmail-debug-info               nil)
> 
> (load-library "smtpmail")
> 
> 
> 
> where you would of course replace "your.smtp.server.here" with the name of
> your actual smtp server.

So no user info should be provided?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 13:43   ` Jack
@ 2004-12-19 14:43     ` D P Schreber
  2004-12-20 13:25       ` Jianbo Zhu
  0 siblings, 1 reply; 19+ messages in thread
From: D P Schreber @ 2004-12-19 14:43 UTC (permalink / raw)


On 2004-12-19, Jack@mail.org <Jack@mail.org> wrote:
> So no user info should be provided?

[PLEASE edit quoted text before posting followups]

My smtp server allows authentication but doesn't require it, so in this
context I never bothered to figure out how to set it up.  If yours
requires authentication, try info for 'SMTP'. Looks like you want to set
smtpmail-auth-credentials and maybe also smtpmail-starttls-credentials.


smtpmail-auth-credentials's value is "~/.authinfo"

Specify username and password for servers, directly or via .netrc file.
This variable can either be a filename pointing to a file in netrc(5)
format, or list of four-element lists that contain, in order,
`servername' (a string), `port' (an integer), `user' (a string) and
`password' (a string, or nil to query the user when needed).  If you
need to enter a `realm' too, add it to the user string, so that it
looks like `user@realm'.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
       [not found] ` <mailman.7260.1103461994.27204.help-gnu-emacs@gnu.org>
@ 2004-12-19 16:09   ` Tim McNamara
  2004-12-19 17:21     ` D P Schreber
  2004-12-19 23:04     ` Daniel Pittman
  0 siblings, 2 replies; 19+ messages in thread
From: Tim McNamara @ 2004-12-19 16:09 UTC (permalink / raw)


Daniel Pittman <daniel@rimspace.net> writes:

> On 19 Dec 2004, Jack@mail.org wrote:
>> Can you tell me how to config my emacs to send mail by using smtp?
>
> That isn't generally the best plan, since using the local sendmail will
> (usually) still put things in the queue even if the server is down.

Only on Unix systems with a functioning sendmail.  Since Emacs runs
on all platforms, there are many users without sendmail.  I use OS X
which has sendmail turned off by default, for example, and I don't
miss it in the slightest.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 16:09   ` How to send a mail using smtp? Tim McNamara
@ 2004-12-19 17:21     ` D P Schreber
  2004-12-19 23:04     ` Daniel Pittman
  1 sibling, 0 replies; 19+ messages in thread
From: D P Schreber @ 2004-12-19 17:21 UTC (permalink / raw)


On 2004-12-19, Tim McNamara <timmcn@bitstream.net> wrote:
> Only on Unix systems with a functioning sendmail.  Since Emacs runs
> on all platforms, there are many users without sendmail.  I use OS X
> which has sendmail turned off by default

I'm pretty sure the default osx configuration has MAILSERVER in
/etc/hostconfig set to "-AUTOMATIC-".   That's certainly how all my Macs
are configured, and I don't remember doing this myself.  With this
setting, no listener on port 25 will be started, but sendmail will work
fine, including queuing when necessary.  Of course you might need to
make adjustments to /etc/postfix/main.cf, particularly if your host has
a lan address.

That's not to say that osx users should necessarily use the sendmail
emacs package rather than the smtpmail package.  But they can if they
want to.

And the previous poster is right: smtpmail is not the best choice if
you're not sure the remote server is accessible at the time you're
trying to send mail.  With sendmail you don't have to worry about that.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 16:09   ` How to send a mail using smtp? Tim McNamara
  2004-12-19 17:21     ` D P Schreber
@ 2004-12-19 23:04     ` Daniel Pittman
  2004-12-20  0:18       ` Daniel Pittman
  1 sibling, 1 reply; 19+ messages in thread
From: Daniel Pittman @ 2004-12-19 23:04 UTC (permalink / raw)


On 20 Dec 2004, Tim McNamara wrote:
> Daniel Pittman <daniel@rimspace.net> writes:
>
>> On 19 Dec 2004, Jack@mail.org wrote:
>>> Can you tell me how to config my emacs to send mail by using smtp?
>>
>> That isn't generally the best plan, since using the local sendmail will
>> (usually) still put things in the queue even if the server is down.
>
> Only on Unix systems with a functioning sendmail.  Since Emacs runs
> on all platforms, there are many users without sendmail.  I use OS X
> which has sendmail turned off by default, for example, and I don't
> miss it in the slightest.

IIRC, Emacs still provides a local MTA, though.  I confess:  I used
'sendmail' as a shorthand for "a local MTA", and use Postfix myself.

In any case, using SMTP for submission in your mailer means that,
really, your mailer should implement most of the components of an MTA.  

Since there are perfectly good packages out there that already implement
most of an MTA - the MTAs themselves - better to use one of them than
reinvent the wheel badly. :)

         Daniel

-- 
The world would be a better place if Larry Wall had been born in
Iceland, or any other country where the native language actually
has syntax.
        -- Peter da Silva

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 23:04     ` Daniel Pittman
@ 2004-12-20  0:18       ` Daniel Pittman
  0 siblings, 0 replies; 19+ messages in thread
From: Daniel Pittman @ 2004-12-20  0:18 UTC (permalink / raw)


On 20 Dec 2004, Daniel Pittman wrote:
> On 20 Dec 2004, Tim McNamara wrote:
>> Daniel Pittman <daniel@rimspace.net> writes:
>>
>>> On 19 Dec 2004, Jack@mail.org wrote:
>>>> Can you tell me how to config my emacs to send mail by using smtp?
>>>
>>> That isn't generally the best plan, since using the local sendmail will
>>> (usually) still put things in the queue even if the server is down.
>>
>> Only on Unix systems with a functioning sendmail.  Since Emacs runs
>> on all platforms, there are many users without sendmail.  I use OS X
>> which has sendmail turned off by default, for example, and I don't
>> miss it in the slightest.
>
> IIRC, Emacs still provides a local MTA, though.  I confess:  I used
> 'sendmail' as a shorthand for "a local MTA", and use Postfix myself.

Ack.  That should read "IIRC, **MacOS-X** still provides a local MTA"

      Daniel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-19 14:43     ` D P Schreber
@ 2004-12-20 13:25       ` Jianbo Zhu
  2004-12-20 22:02         ` Duane Winner
  0 siblings, 1 reply; 19+ messages in thread
From: Jianbo Zhu @ 2004-12-20 13:25 UTC (permalink / raw)


D P Schreber <schreberdp@rayban.net> writes:

> On 2004-12-19, Jack@mail.org <Jack@mail.org> wrote:
> > So no user info should be provided?
> 
> [PLEASE edit quoted text before posting followups]
> 
> My smtp server allows authentication but doesn't require it, so in this
> context I never bothered to figure out how to set it up.  If yours
> requires authentication, try info for 'SMTP'. Looks like you want to set
> smtpmail-auth-credentials and maybe also smtpmail-starttls-credentials.
> 
> 
> smtpmail-auth-credentials's value is "~/.authinfo"
> 
> Specify username and password for servers, directly or via .netrc file.
> This variable can either be a filename pointing to a file in netrc(5)
> format, or list of four-element lists that contain, in order,
> `servername' (a string), `port' (an integer), `user' (a string) and
> `password' (a string, or nil to query the user when needed).  If you
> need to enter a `realm' too, add it to the user string, so that it
> looks like `user@realm'.
>  

I've got the following error while I try to send a message.

You are not authorized to send mail as <MAIL FROM: <mouse0407@163.com>>, authentication is require


This is part of my .emacs file:

(require ' smtpmail)
(setq send-mail-function                'smtpmail-send-it)
(setq message-send-mail-function        'smtpmail-send-it)
(setq smtpmail-default-smtp-server      "smtp.163.com")
(setq smtpmail-smtp-server "smtp.163.com")
(setq smtpmail-debug-info t) ; only to debug problems
(setq smtpmail-auth-credentials '("smtp.163.com" 25 "mouse0407@163.com" "*****"))

Can you tell me what I had missed?


Regards,
Jack

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-20 13:25       ` Jianbo Zhu
@ 2004-12-20 22:02         ` Duane Winner
  2004-12-21  6:50           ` Bob Babcock
  0 siblings, 1 reply; 19+ messages in thread
From: Duane Winner @ 2004-12-20 22:02 UTC (permalink / raw)


Jianbo Zhu wrote:
> D P Schreber <schreberdp@rayban.net> writes:
> 
> 
>>On 2004-12-19, Jack@mail.org <Jack@mail.org> wrote:
>>
>>>So no user info should be provided?
>>
>>[PLEASE edit quoted text before posting followups]
>>
>>My smtp server allows authentication but doesn't require it, so in this
>>context I never bothered to figure out how to set it up.  If yours
>>requires authentication, try info for 'SMTP'. Looks like you want to set
>>smtpmail-auth-credentials and maybe also smtpmail-starttls-credentials.
>>
>>
>>smtpmail-auth-credentials's value is "~/.authinfo"
>>
>>Specify username and password for servers, directly or via .netrc file.
>>This variable can either be a filename pointing to a file in netrc(5)
>>format, or list of four-element lists that contain, in order,
>>`servername' (a string), `port' (an integer), `user' (a string) and
>>`password' (a string, or nil to query the user when needed).  If you
>>need to enter a `realm' too, add it to the user string, so that it
>>looks like `user@realm'.
>> 
> 
> 
> I've got the following error while I try to send a message.
> 
> You are not authorized to send mail as <MAIL FROM: <mouse0407@163.com>>, authentication is require
> 
> 
> This is part of my .emacs file:
> 
> (require ' smtpmail)
> (setq send-mail-function                'smtpmail-send-it)
> (setq message-send-mail-function        'smtpmail-send-it)
> (setq smtpmail-default-smtp-server      "smtp.163.com")
> (setq smtpmail-smtp-server "smtp.163.com")
> (setq smtpmail-debug-info t) ; only to debug problems
> (setq smtpmail-auth-credentials '("smtp.163.com" 25 "mouse0407@163.com" "*****"))
> 
> Can you tell me what I had missed?

I have been trying to get smtpmail to work with authentication, and have 
been having the same problem. I also posted a question over on 
gnu.emacs.vm.info looking for a solution.

Hopefully someone will have an answer to this.

Cheers,
Duane



> 
> 
> Regards,
> Jack

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-20 22:02         ` Duane Winner
@ 2004-12-21  6:50           ` Bob Babcock
  2004-12-21 15:26             ` Duane Winner
  0 siblings, 1 reply; 19+ messages in thread
From: Bob Babcock @ 2004-12-21  6:50 UTC (permalink / raw)


Duane Winner <duanewinner@att.net> wrote in
news:41C74C31.8040305@att.net: 

> I have been trying to get smtpmail to work with authentication, and
> have been having the same problem.

I was told that a newer version of smtpmail.el was necessary to get this to 
work.  I think the version that worked came from 
http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp?
  2004-12-21  6:50           ` Bob Babcock
@ 2004-12-21 15:26             ` Duane Winner
  2004-12-21 18:51               ` How to send a mail using smtp? - solved! (but need help with "Mail From:") Duane Winner
  0 siblings, 1 reply; 19+ messages in thread
From: Duane Winner @ 2004-12-21 15:26 UTC (permalink / raw)


Bob Babcock wrote:
> Duane Winner <duanewinner@att.net> wrote in
> news:41C74C31.8040305@att.net: 
> 
> 
>>I have been trying to get smtpmail to work with authentication, and
>>have been having the same problem.
> 
> 
> I was told that a newer version of smtpmail.el was necessary to get this to 
> work.  I think the version that worked came from 
> http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/

I grabbed this and put it in 
/usr/local/share/emacs/21.3/lisp/mail/smtpmail.el (replacing current 
version).

Still have the problem, though.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-21 15:26             ` Duane Winner
@ 2004-12-21 18:51               ` Duane Winner
  2004-12-21 19:12                 ` Tim McNamara
  2004-12-21 19:28                 ` Bob Babcock
  0 siblings, 2 replies; 19+ messages in thread
From: Duane Winner @ 2004-12-21 18:51 UTC (permalink / raw)


Duane Winner wrote:
> Bob Babcock wrote:
> 
>> Duane Winner <duanewinner@att.net> wrote in
>> news:41C74C31.8040305@att.net:
>>
>>> I have been trying to get smtpmail to work with authentication, and
>>> have been having the same problem.
>>
>>
>>
>> I was told that a newer version of smtpmail.el was necessary to get 
>> this to work.  I think the version that worked came from 
>> http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/
> 
> 
> I grabbed this and put it in 
> /usr/local/share/emacs/21.3/lisp/mail/smtpmail.el (replacing current 
> version).
> 
> Still have the problem, though.
> 

OK -- good news: I got authentication working with smtpmail.el  -- I 
didn't realize that I needed to byte-compile smtpmail.el. I am now 
connecting to my ISP's smtp  server and successfully authenticating and 
sending.

But now I am having a problem with the "From:" format. All of my 
outbound emails are addressed as "From: me@localhost" instead of being 
rewritten the proper user@domain (myaccount@myisp.net)

First, how I got authentication working:

1. Download the latest smtpmail.el from:
http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mail/
to a temporary directory to which you have read/write privs.

2. In emacs, type:
M-x byte-compile-file <RETURN>
Enter <path-to>/smtpmail.el

3. Now have an smtpmail.el and smtpmail.elc. Copy them to 
/usr/local/share/emacs/21.3/lisp/mail
(This is my path on FreeBSD 5.2.1 -- change to your correct path).

4. My obfuscated .emacs:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Please add these lines in your .emacs(_emacs) or use customize.
;;
(setq send-mail-function 'smtpmail-send-it) ; if you use `mail'
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "localhost")
(setq smtpmail-smtp-service 465)
(setq smtpmail-local-domain "att.net")
(setq smtpmail-sendto-domain "att.net")
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verb t)
(setq smtpmail-auth-credentials
       '(("localhost" 465 "myaccountname" "mypassword")))
;;(setq smtpmail-starttls-credentials
;;      '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
;; Where the 25 equals the value of `smtpmail-smtp-service', it can be an
;; integer or a string, just as long as they match (eq).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Note I am going to localhost on port 465 -- this is because my ISP uses 
SSL. I am using an stunnel connection from my localhost:465 to 
myisp:465. Next step: see if smtpmail-startttls-credentials works so I 
don't have to use stunnel.

5. My debug output:

MAIL FROM:<dwinner@localhost> SIZE=212^M
250 ok^M
RCPT TO:<duanewinner@att.net>^M
250 ok^M
DATA^M
354 ok^M
Date: 21 Dec 2004 13:44:29 -0500^M
Message-ID: <86d5x3ze2a. fsf@localhost>^M
From: Duane Winner <dwinner@localhost>^M
To: duanewinner@att.net^M
Subject: test #328^M
^M
more test stuff^M
from me^M
.^M
250 ok ; id=2004122118443011100j8luue^M
QUIT^M
221 myisp.isp.net^M


6. So now my only problem is controlling the "MAIL FROM:" and "From:" 
fields so that they return "myispaccountname@myisp.domain.net" instead 
of "mylocalaccountname@mylocalhost".

Any ideas?

Thanks again,
Duane

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-21 18:51               ` How to send a mail using smtp? - solved! (but need help with "Mail From:") Duane Winner
@ 2004-12-21 19:12                 ` Tim McNamara
  2004-12-21 19:28                 ` Bob Babcock
  1 sibling, 0 replies; 19+ messages in thread
From: Tim McNamara @ 2004-12-21 19:12 UTC (permalink / raw)


Duane Winner <duanewinner@att.net> writes:

> 6. So now my only problem is controlling the "MAIL FROM:" and "From:"
>    fields so that they return "myispaccountname@myisp.domain.net"
>    instead of "mylocalaccountname@mylocalhost".
> Any ideas?

Try this in your .emacs or .gnus:

  (setq user-full-name "Duane Winner")
  (setq user-mail-address "duanewinner@att.net)

Also, for authenticated SMTP, I use (obfuscated to protect the
innocent):

  (add-to-list 'gnus-secondary-select-methods '(nnml ""))
  (eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(pop :server "pop.myisp.com"
                                    :user "my-email@address"
                                    :password "mypassword")))
  (require 'smtpmail)
  (setq send-mail-function 'smtpmail-send-it)
  (setq message-send-mail-function 'smtpmail-send-it)
  (setq smtpmail-smtp-server "smtp.myserver.com")
  (setq smtpmail-local-domain "myisp.tld")
  (setq smtpmail-queue-mail nil)
  (setq smtpmail-debug-info nil)
  (setq smtpmail-auth-credentials
      '(("smtp.myserver.com" 25 "myusername" "mypassword")))

Which seems to work just dandy.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-21 18:51               ` How to send a mail using smtp? - solved! (but need help with "Mail From:") Duane Winner
  2004-12-21 19:12                 ` Tim McNamara
@ 2004-12-21 19:28                 ` Bob Babcock
  2004-12-21 22:48                   ` Kevin Rodgers
  1 sibling, 1 reply; 19+ messages in thread
From: Bob Babcock @ 2004-12-21 19:28 UTC (permalink / raw)


Duane Winner <duanewinner@att.net> wrote in
news:2h_xd.17273$uM5.13591@bgtnsc05-news.ops.worldnet.att.net: 

> 6. So now my only problem is controlling the "MAIL FROM:" and "From:" 
> fields so that they return "myispaccountname@myisp.domain.net" instead
> of "mylocalaccountname@mylocalhost".

There's probably a better way, but for a long time I have been using the 
following hook to insert the From: and Reply-to: lines.  (Note that I'm 
doing this in emacs 20.7.  My ISP isn't yet _requiring_ authenticated smtp, 
so while I've gotten it to work in 21.3, I haven't moved everything else to 
that version yet.)

(add-hook 'mail-setup-hook
  (function
    (lambda ()
      (setq fill-column 77)
      (turn-on-auto-fill)
      (save-excursion
        (progn
          (goto-char (point-min))
          (forward-line 1)
          (insert "From: My Name <username@domain.net>\n")))
      (save-excursion
        (progn
          (goto-char (point-max))
          (forward-line -1)
          (insert "Reply-to: username@domain.net\n")))
      (setq tab-width 8))))

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-21 19:28                 ` Bob Babcock
@ 2004-12-21 22:48                   ` Kevin Rodgers
  2004-12-22  4:25                     ` Bob Babcock
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Rodgers @ 2004-12-21 22:48 UTC (permalink / raw)


Bob Babcock wrote:
 > There's probably a better way, but for a long time I have been using the
 > following hook to insert the From: and Reply-to: lines.  (Note that I'm
 > doing this in emacs 20.7.  My ISP isn't yet _requiring_ authenticated 
smtp,
 > so while I've gotten it to work in 21.3, I haven't moved everything 
else to
 > that version yet.)
 >
 > (add-hook 'mail-setup-hook
 >   (function
 >     (lambda ()
 >       (setq fill-column 77)
 >       (turn-on-auto-fill)
 >       (save-excursion
 >         (progn
 >           (goto-char (point-min))
 >           (forward-line 1)
 >           (insert "From: My Name <username@domain.net>\n")))
 >       (save-excursion
 >         (progn
 >           (goto-char (point-max))
 >           (forward-line -1)
 >           (insert "Reply-to: username@domain.net\n")))
 >       (setq tab-width 8))))

Yes, there's a better way, since Emacs has anticipated your problems and
provided variables to solve them:

(setq user-full-name "My Name"
       user-mail-address "username@domain.net"
       mail-default-reply-to user-mail-address
       mail-from-style  'angles)

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-21 22:48                   ` Kevin Rodgers
@ 2004-12-22  4:25                     ` Bob Babcock
  2004-12-22 17:58                       ` Kevin Rodgers
  0 siblings, 1 reply; 19+ messages in thread
From: Bob Babcock @ 2004-12-22  4:25 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> wrote in
news:32rnhkF3qqskdU1@individual.net: 

> Yes, there's a better way, since Emacs has anticipated your problems
> and provided variables to solve them:
> 
> (setq user-full-name "My Name"
>        user-mail-address "username@domain.net"
>        mail-default-reply-to user-mail-address
>        mail-from-style  'angles)

That's what happens when you migrate .emacs from release to release over a 
period of years; you end up with stuff that is no longer necessary.  On the 
other hand, the above elisp (in emacs 20.3 rmail) doesn't insert the From: 
line until the mail is sent.  I like to see it during message composition.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: How to send a mail using smtp? - solved! (but need help with "Mail From:")
  2004-12-22  4:25                     ` Bob Babcock
@ 2004-12-22 17:58                       ` Kevin Rodgers
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Rodgers @ 2004-12-22 17:58 UTC (permalink / raw)


Bob Babcock wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> wrote in
> news:32rnhkF3qqskdU1@individual.net: 
> 
> 
>>Yes, there's a better way, since Emacs has anticipated your problems
>>and provided variables to solve them:
>>
>>(setq user-full-name "My Name"
>>       user-mail-address "username@domain.net"
>>       mail-default-reply-to user-mail-address
>>       mail-from-style  'angles)
> 
> 
> That's what happens when you migrate .emacs from release to release over a 
> period of years; you end up with stuff that is no longer necessary.  On the 
> other hand, the above elisp (in emacs 20.3 rmail) doesn't insert the From: 
> line until the mail is sent.  I like to see it during message composition.

C-h v mail-default-headers

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-12-22 17:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-19  9:11 How to send a mail using smtp? Jack
2004-12-19 12:29 ` Daniel Pittman
2004-12-19 13:08 ` D P Schreber
2004-12-19 13:43   ` Jack
2004-12-19 14:43     ` D P Schreber
2004-12-20 13:25       ` Jianbo Zhu
2004-12-20 22:02         ` Duane Winner
2004-12-21  6:50           ` Bob Babcock
2004-12-21 15:26             ` Duane Winner
2004-12-21 18:51               ` How to send a mail using smtp? - solved! (but need help with "Mail From:") Duane Winner
2004-12-21 19:12                 ` Tim McNamara
2004-12-21 19:28                 ` Bob Babcock
2004-12-21 22:48                   ` Kevin Rodgers
2004-12-22  4:25                     ` Bob Babcock
2004-12-22 17:58                       ` Kevin Rodgers
     [not found] ` <mailman.7260.1103461994.27204.help-gnu-emacs@gnu.org>
2004-12-19 16:09   ` How to send a mail using smtp? Tim McNamara
2004-12-19 17:21     ` D P Schreber
2004-12-19 23:04     ` Daniel Pittman
2004-12-20  0:18       ` Daniel Pittman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).