all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: gnus with multiple mail accounts
Date: Thu, 15 Oct 2020 18:12:08 -0700	[thread overview]
Message-ID: <87y2k755zr.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87tuuvdvky.fsf@freegnu.i-did-not-set--mail-host-address--so-tickle-me

Jeremie Juste <juste@inspiring-development.com> writes:

> Hello,
>
> I would like send mail from more than one mail account from gnus.
> I tried to use X-Message-SMTP-Method (info "(gnus) Posting Styles") 
> but I don't know how to change the smtpmail-stream-type.
>
>
> So I have come up with the following function. I only need to automate
> it to do the right assignment depending on which group I'm in. Do you
> have any lead please?
>
> (defun set-smtp (arg)
>   "switch mail server"
>   (interactive "p")
>   (if (eq arg 1)
>       (setq message-send-mail-function 'smtpmail-send-it
> 	    smtpmail-default-smtp-server "smtp.office365.com"
> 	    smtpmail-smtp-server "smtp.office365.com"
> 	    user-mail-address "<mail1.com>"
> 	    smtpmail-smtp-service 587
> 	    smtpmail-stream-type 'starttls
> 	    )
>     (setq message-send-mail-function 'smtpmail-send-it
> 	  smtpmail-default-smtp-server "smtp.gmail.com"
> 	  smtpmail-smtp-server "smtp.gmail.com"
> 	  user-mail-address "<mail2.gmail.com>"
> 	  smtpmail-smtp-service 465
> 	  smtpmail-stream-type 'ssl
> 	  )
>     ))

Are you sure it doesn't work just to set host and port in the
pseudo-header? Looking at the code, it ought to be setting
`smtpmail-stream-type' correctly from the port. I assume you've tried
that and it didn't work?




  reply	other threads:[~2020-10-16  1:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 21:32 gnus with multiple mail accounts Jeremie Juste
2020-10-16  1:12 ` Eric Abrahamsen [this message]
2020-10-16  7:24   ` Jeremie Juste
2020-10-16  8:50   ` Robert Pluim
2020-10-16 10:15     ` Robert Pluim
2020-10-16 10:38     ` Pankaj Jangid
2020-10-16 15:54     ` Eric S Fraga
2020-10-16 16:09       ` Robert Pluim
2020-10-16 20:19         ` Jeremie Juste
2020-10-17  6:30           ` Pankaj Jangid
2020-10-17 11:45         ` Eric S Fraga
2020-10-18 17:35           ` Robert Pluim
2020-10-16  6:42 ` Pankaj Jangid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2k755zr.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.