src/Pure/General/mail.scala
changeset 79444 71fde9e76ca9
parent 79443 0d7c7fe65638
child 79979 a4100b7ab951
--- a/src/Pure/General/mail.scala	Tue Jan 09 17:35:56 2024 +0100
+++ b/src/Pure/General/mail.scala	Wed Jan 10 10:25:55 2024 +0100
@@ -48,6 +48,7 @@
 
     private def mail_session: JSession = {
       val props = new JProperties()
+      props.setProperty("mail.smtp.from", sender.toString)
       props.setProperty("mail.smtp.host", smtp_host)
       props.setProperty("mail.smtp.port", smtp_port.toString)
       props.setProperty("mail.smtp.auth", use_auth.toString)
@@ -64,7 +65,7 @@
       val authenticator = new Authenticator() {
         override def getPasswordAuthentication = new PasswordAuthentication(user, password)
       }
-      JSession.getDefaultInstance(props, authenticator)
+      JSession.getInstance(props, authenticator)
     }
 
     def defined: Boolean = smtp_host.nonEmpty