package main import ( "bytes" "net/smtp" "gitea.urkob.com/urko/emailsender/pkg/email" ) func main() { // Here fill with real data emailService := email.NewInsecure(email.MailServiceConfig{ Auth: smtp.PlainAuth("", "your@email.com", "your-password", "smtp.youremail.com"), Host: "smtp.youremail.com", Port: "587", From: "your@email.com", }) emailService.SendEmail(email.EmailMessage{ To: "other@email.com", Subject: "Test Email", Body: "
Here your body, you can attach as html
", Attachments: []email.EmailAttachment{ { File: bytes.NewBuffer([]byte("test")), // This is an io.Reader Title: "document.pdf", }, }, }) }