diff --git a/.gitignore b/.gitignore index 3532c8ca..e25825b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ target/ local/ _site/ -result \ No newline at end of file +result +.bloop +project/**/project +metals.sbt +.vscode +.metals +.bsp diff --git a/modules/common/src/main/scala/emil/builder/package.scala b/modules/common/src/main/scala/emil/builder/package.scala index fb5bb827..ca9c7332 100644 --- a/modules/common/src/main/scala/emil/builder/package.scala +++ b/modules/common/src/main/scala/emil/builder/package.scala @@ -57,6 +57,13 @@ package builder { mail.mapMailHeader(_.mapRecipients(_.addBccs(mas))) } + case class ReplyTo[F[_]](ma: MailAddress) extends Trans[F] { + def apply(mail: Mail[F]): Mail[F] = + mail.mapMailHeader(_.copy(replyTo = Some(ma))) + } + + object ReplyTo extends MailAddressHelper[ReplyTo] + case class Subject[F[_]](text: String) extends Trans[F] { def apply(mail: Mail[F]): Mail[F] = mail.mapMailHeader(_.withSubject(text)) diff --git a/modules/javamail/src/main/scala/emil/javamail/conv/BasicEncode.scala b/modules/javamail/src/main/scala/emil/javamail/conv/BasicEncode.scala index ffc22b80..7a20a8f3 100644 --- a/modules/javamail/src/main/scala/emil/javamail/conv/BasicEncode.scala +++ b/modules/javamail/src/main/scala/emil/javamail/conv/BasicEncode.scala @@ -137,6 +137,9 @@ trait BasicEncode { Message.RecipientType.BCC, header.recipients.bcc.map(ca.convert).map(a => a.asInstanceOf[Address]).toArray ) + msg.setReplyTo( + header.replyTo.map(ca.convert).map(a => a.asInstanceOf[Address]).toArray + ) if (header.flags.nonEmpty) { val flags = new Flags()