mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
Fixed example code
This commit is contained in:
parent
81cf2e646c
commit
c41301e26b
1 changed files with 4 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
||||||
package mail
|
package mail_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/wneessen/go-mail"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ func ExampleClient_DialAndSend() {
|
||||||
to := "Alice <alice@example.com>"
|
to := "Alice <alice@example.com>"
|
||||||
server := "mail.example.com"
|
server := "mail.example.com"
|
||||||
|
|
||||||
m := NewMsg()
|
m := mail.NewMsg()
|
||||||
if err := m.From(from); err != nil {
|
if err := m.From(from); err != nil {
|
||||||
fmt.Printf("failed to set FROM address: %s", err)
|
fmt.Printf("failed to set FROM address: %s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -21,7 +22,7 @@ func ExampleClient_DialAndSend() {
|
||||||
}
|
}
|
||||||
m.Subject("This is a great subject")
|
m.Subject("This is a great subject")
|
||||||
|
|
||||||
c, err := NewClient(server)
|
c, err := mail.NewClient(server)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("failed to create mail client: %s", err)
|
fmt.Printf("failed to create mail client: %s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
Loading…
Reference in a new issue