package
0.7.5
Repository: https://github.com/infiniteloopcloud/go.git
Documentation: pkg.go.dev

# README

Email

Usage

package main

import (
	"context"

	"gitlab.com/metricsglobal/misc-go/email"
)

func main() {
	provider, err := email.NewProvider(context.Background(), email.Opts{
		Provider: email.SMTPProvider, // Use smtp config
		SmtpConfig: &email.SmtpConfig{
			Host:     "smtp.google.com",
			Port:     587,
			Username: "username",
			Password: "<password>",
		},
	})
	if err != nil {
		panic(err)
	}

	// Set the data
	data := email.Data{
		Sender:   "[email protected]",
		Subject:  "Important email",
		BodyHTML: `<html><body><h1>Welcome to my site</h1></body></html>`,
		Body:     "Welcome to my site",
		Charset:  email.DefaultCharset,
		ToAddresses: []string{
			"[email protected]",
		},
		CCAddresses: nil,
	}

	_, err = provider.Send(context.Background(), data)
	if err != nil {
		panic(err)
    }
}

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author