mail/

directory
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: MIT

README

PTGU Mail

Import

import (
	PTGUmail "github.com/parinyapt/golang_utils/mail/v1"
)

Example

Send Mail v1
func main() {
	err := PTGUmail.SendMail(PTGUmail.ParamConfigSendMail{
		SMTP: PTGUmail.ParamConfigSendMailSMTP{
			Host:     "smtp.gmail.com",
			Port:     587,
			Username: "demo@example.com",
			Password: "EMAIL_PASSWORD",
		},
		From: PTGUmail.ParamConfigSendMailFrom{
			AliasName: "PTGU",
			Email:     "demo@example.com",
		},
		To: PTGUmail.ParamConfigSendMailTo{
			Email:    []string{"demo1@example.com", "demo2@example.com"},
			Subject:  "Demo Subject",
			BodyType: PTGUmail.BodyTypePlain,
			Body:     "Hello World",
		},
	})
	if err != nil {
		panic(err)
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL