Documentation ¶
Overview ¶
Package postfix is for sending mail
import (
"github.com/vanng822/postfix"
)
fromAddr := postfix.NewAddress(from, fromEmail) toAddr := postfix.NewAddress(to, toEmail) msg, err := postfix.MultipartMessage(fromAddr, toAddr, subject, text, html)
if err != nil { log.Fatal("Postfix mailing with error", err) }
err := postfix.Send(msg)
if err != nil { log.Fatal("Postfix mailing with error", err) }
Index ¶
- func MultipartMessage(from *mail.Address, to *mail.Address, subject, text, html string) (*mail.Message, error)
- func NewAddress(name, address string) *mail.Address
- func Send(msg *mail.Message) error
- func SetClientFactory(f func() (c *smtp.Client, err error))
- func SetHost(h string)
- func SetPort(p int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MultipartMessage ¶
func MultipartMessage(from *mail.Address, to *mail.Address, subject, text, html string) (*mail.Message, error)
MultipartMessage create a message with multipart text and html html part is parsed and applied css inline styling
func NewAddress ¶
NewAddress return new mail.Address
func SetClientFactory ¶
SetClientFactory for setting a smtp client if needed
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.