How to configure Emacs to send email?

Hello,
I have read the relevant sections of the emacs manual hoping to get my emacs program set up to send email.

My ISP uses an SMTP server on port 465 and I have verified that the server is up and running by an nmap port scan. I have even inserted the IP number rather than the hostname address.

My machine is running FreeBSD 9 and is fully up to date.

This is the contents of my .emacs file:

Code:
(setq send-mail-function 'smtpmail-send-it
smtp-starttls-credentials '(("62.254.26.195" 465 nil nil))
smtpmail-auth-credentials (expand-file-name "~/.authinfo"))
(setq smtpmail-smtp-server "62.254.26.195")
(setq smtpmail-smtp-service 465)

When I C-C C-C to send the message, I get an error in the mini buffer that says:
Code:
Process SMTP not running
I have tried to find the answer via google but no clear answer seems to be available. Is anyone able to help with this?
 
This works for me.

Code:
(setq message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials '(("smtp.gmail.com" 587 "my_username" nil))
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      smtpmail-local-domain "mydomain")
 
I used identical syntax in my .emacs file and got prompted for a password. When I input the password I got a 'smtp protocol error' with my gmail account. My ISP smtp does not run on port 25 only port 465.
 
If you're connecting directly to SSL-port bypassing STARTTLS try setting
Code:
(setq smtpmail-stream-type 'tls)
 
This worked fine for me for a long time:

Code:
(setq smtpmail-smtp-server "smtp.hostname.net.au") 
   (setq smtpmail-smtp-service 25)
(setq smtpmail-debug-info t)
   (setq smtpmail-debug-verb t)
   (setq send-mail-function 'smtpmail-send-it)
   (setq message-send-mail-function 'smtpmail-send-it)
   (require 'smtpmail)

... but then my ISP changed *something* on their end, and I kept getting the same error you did (although you should have a look at the gnus backtrace (turn debug on, if you haven't already, using the relevant code from above)). Adding the following fixed the problem:

Code:
'(smtpmail-stream-type (quote plain))

You can also get there through: M-x customize-option <RET> smtpmail-stream-type <RET>

I don't know if any of that will be of help to you, but if not then I highly recommend posting your problem to the gnu.emacs.help mailing list. That's what I did, and I ended up receiving help from the guy who actually developed Gnus (i.e. Lars Ingebrigtsen).
 
Back
Top