simplesms

package module
v0.0.0-...-966bdeb Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 3 Imported by: 0

README

simple-sms-go

a simple package for sending sms via carrier email gateway, using smtp.PlainAuth

Usage

intialize a client with username, password, and details for your smtp provider

emailClient := simplesms.NewClient("username", "password", "smtp.gmail.com", "587")

send the sms by providin a number, provider, subject, and message

emailClient.Send(5555555432, emailClient.Providers.TMO, "Hello?", "Hello world!")

Note

The carriers seem to be picky about how many emails are sent in this way and what their contents are. This is really meant to be used sparingly for simple occasional things.

This also only supports a limited number of carriers, but I'm happy to accept PRs with additional gateways.

Documentation

Index

Constants

View Source
const (
	TMO string = "TMO"
	ATT string = "ATT"
	VRZ string = "VRZ"
)

Variables

This section is empty.

Functions

func CheckProvider

func CheckProvider(prov string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username string, password string, smtpHost string, smtpPort string) *Client

func (*Client) Send

func (c *Client) Send(phoneNum int, prov string, subject string, message string) error

Jump to

Keyboard shortcuts

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