Skip to content

Sending a mail fails with no output #66

Description

@Iltotore

Courier version: 4.0.0-RC1
Scala version: 3.5.1

I'm trying to send a mail to my DebugMail project with the following information provided (in Python/Flask config) by the website.

app.config["MAIL_SERVER"]="app.debugmail.io"
app.config["MAIL_PORT"] = 25
app.config["MAIL_USERNAME"] = "..."
app.config["MAIL_PASSWORD"] = "..."
app.config["MAIL_USE_TLS"] = True

Here is the code I use to send a mail:

val mailer =
  Mailer(sys.env("MAIL_HOST"), sys.env("MAIL_PORT").toInt)
    .debug(true)
    .auth(true)
    .as(sys.env("MAIL_USER"), sys.env("MAIL_PASSWORD"))
    .startTls(true)()

mailer(
  Envelope
    .from("newsletter" `@` "...")
    .to(InternetAddress(email))
    .subject(lang("newsletter.subscribe.subject"))
    .content(mailContent(
      lang.language,
      h1(lang("newsletter.subscribe.title")),
      p(lang("newsletter.subscribe.description")),
      a(lang("index.unsubscribe"))
    ))
)
.onComplete:
  case Success(_) => println(s"Successfully sent mail to $email")
  case Failure(exception) => exception.printStackTrace()

The code is executed but for some reason I have nothing in DebugMail and no output at all in my console: no print nor stacktrace. I would expect this code to either work or complete with an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions