Skip to content

Commit

Permalink
Update doc to reflect updated scala Future's api
Browse files Browse the repository at this point in the history
Fixes #59
  • Loading branch information
daddykotex committed Jul 30, 2021
1 parent 956c522 commit 9533af2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ deliver electronic mail via gmail

```scala
import courier._, Defaults._
import scala.util._
val mailer = Mailer("smtp.gmail.com", 587)
.auth(true)
.as("[email protected]", "p@$$w3rd")
Expand All @@ -34,8 +35,9 @@ mailer(Envelope.from("you" `@` "gmail.com")
.to("mom" `@` "gmail.com")
.cc("dad" `@` "gmail.com")
.subject("miss you")
.content(Text("hi mom"))).onSuccess {
case _ => println("message delivered")
.content(Text("hi mom"))).onComplete {
case Success(_) => println("message delivered")
case Failure(_) => println("delivery failed")
}

mailer(Envelope.from("you" `@` "work.com")
Expand All @@ -44,8 +46,9 @@ mailer(Envelope.from("you" `@` "work.com")
.content(Multipart()
.attach(new java.io.File("tps.xls"))
.html("<html><body><h1>IT'S IMPORTANT</h1></body></html>")))
.onSuccess {
case _ => println("delivered report")
.onComplete {
case Success(_) => println("delivered report")
case Failure(_) => println("delivery failed")
}
```

Expand Down

0 comments on commit 9533af2

Please sign in to comment.