stun
is a simple and flexible Go library for email automation. It provides a convenient way to send emails using the Go programming language.
- Basic Email Sending: Send plain text emails easily.
- Environment Variable Support: Securely read email credentials from environment variables.
- Configurable SMTP Server: Easily configure the SMTP server details.
go get github.com/C-o-m-o-n/stun
- !) generated by chat gpt
package main
import (
"github.com/C-o-m-o-n/stun"
)
func main() {
// Create a new Email instance
email := stun.NewEmail("recipient@example.com", "Test Subject", "This is the email body.")
// Send the email
err := email.Send()
if err != nil {
panic(err)
}
}
- !!) generated by Github copilot
package main
import (
"fmt"
"testing"
)
func TestEmailSend(t *testing.T) {
email := &Email{
From: "sender@gmail.com",
To: "receiver@gmail.com",
Subject: "Test Email",
Body: "This is a test email.",
}
err := email.Send()
if err != nil {
t.Errorf("Failed to send email: %v", err)
} else {
fmt.Println("Email sent successfully")
}
}
Contributions are welcome! Please feel free to open issues or pull requests.
- First, fork the repo from my account
- Learn how to fork a github repo from here
- Next, Clone the fork to your local machine
- Learn how to clone a github repo fromhere
- Next, Add your changes, commit and push them to github
- Learn how to push code to a github repo from here
- Next, open a pull request
- Learn more about creating pull requests from here
NOTE: Don't be afriad to push your changes even if you think they maight have bugs. We will debug them together
Peace!!