-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update doc to reflect updated scala Future's api
Fixes #59
- Loading branch information
1 parent
956c522
commit 9533af2
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
@@ -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") | ||
|
@@ -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") | ||
} | ||
``` | ||
|
||
|