mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
More examples
This commit is contained in:
parent
c41301e26b
commit
6bc9832ede
1 changed files with 22 additions and 0 deletions
22
doc_test.go
22
doc_test.go
|
@ -6,6 +6,28 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Code example for the NewClient method
|
||||||
|
func ExampleNewClient() {
|
||||||
|
c, err := mail.NewClient("mail.example.com")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
_ = c
|
||||||
|
// Output:
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code example for the Client.SetTLSPolicy method
|
||||||
|
func ExampleClient_SetTLSPolicy() {
|
||||||
|
c, err := mail.NewClient("mail.example.com")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
c.SetTLSPolicy(mail.TLSMandatory)
|
||||||
|
fmt.Println(c.TLSPolicy())
|
||||||
|
// Output: TLSMandatory
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code example for the Client.DialAndSend method
|
||||||
func ExampleClient_DialAndSend() {
|
func ExampleClient_DialAndSend() {
|
||||||
from := "Toni Tester <toni@example.com>"
|
from := "Toni Tester <toni@example.com>"
|
||||||
to := "Alice <alice@example.com>"
|
to := "Alice <alice@example.com>"
|
||||||
|
|
Loading…
Reference in a new issue