fmorenovr / gomail

GoMail is a SMTP library implemented in golang.

Home Page:https://godoc.org/github.com/fmorenovr/gomail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang + Mail = GoMail (Gomail)

goMail (Golang for SMTP) is a Golang implementation for Simple Mail Transfer Protocol service. You can see an extended doc in godocs.

SMTP

SMTP is a protocol that you can send secure text messages trough the internet.
See more info here.

goMail

  • First, You should download my library:

    go get github.com/fmorenovr/gomail/
    
  • Then, you should use for differents implements in Go.

    • First, Create a gomail object:

        gomailObject := gomail.NewGomail()
      
        // credentials
        gomailObject.Set("Username", "aduncus@gomail.com")
        gomailObject.Set("Password", "********")
      
        // servername
        gomailObject.Set("Servername", "smtp.gmail.com:465")
        
        // from
        gomailObject.Set("From", "example@gomail.com")
        gomailObject.Set("From_name", "gomail Service")
      
        // to
        gomailObject.Set("To", "person1@gomail.com")
        gomailObject.Set("To_name", "Person 1")
      
        // subject
        gomailObject.Set("Subject", "This is the email subject")
      
        // body message
        gomailObject.Set("BodyMessage", "This is the fabulous body message\n\nGood Luck!!")
      
  • Finally, send a message:

     err := gomailObject.SendMessage()
     fmt.Println("Error: ", err)
    

About

GoMail is a SMTP library implemented in golang.

https://godoc.org/github.com/fmorenovr/gomail

License:MIT License


Languages

Language:Go 100.0%