Skip to content

ale8k/mua_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mua_go

Go Reference Go Report Card Release Tests

Summary

A basic SMTP client to send and receive emails for a given address(s).

Sending an email example:

func main() {
	mailAddress := ""
	mailPwd := ""

	client := mua.NewMailClient(mailAddress, mailPwd, "smtp-mail.outlook.com:587")
	client.OpenSMTPConnection(true)

	mailBuilder := mua.MailBuilder{}
	mailBuilder.SetTo(mailAddress)
	mailBuilder.SetFrom("digletti", mailAddress)
	mailBuilder.SetSubject("test 3")
	mailBuilder.UpdateMailBodyString("sending mail")

	client.SendNewMail(mailAddress, string(mailBuilder.Build()))

	mailBuilder.SetSubject("test 4")
	client.SendNewMail(mailAddress, string(mailBuilder.Build())) // isnt sending, huh ?
	err := client.CloseSMTPConnection()
	fmt.Println(err)
}

About

Mail User Agent in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages