Thanks to visit codestin.com
Credit goes to github.com

Skip to content

guidopola/zohosendmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

A Go library to send mails with Zoho.net

What is this?

This is a simple library for sending emails with the zoho.net REST API.

Usage

Get the auth token.

Log in your zoho mail and go to Zoho.net API auth token create

Import the module
import "github.com/guidopola/zohosendmail"
Create the zohosendmail object
zm, err := zohosendmail.New(ZohoAuthToken)
Send an email
err := zm.SendMail("[email protected]", "Test subject", "This is a test email body!", nil)
To add an attachment.
// Read the file contents
content, err := ioutil.ReadFile("./example.zip")

// Upload the attachment to zoho.
attachment, err := zm.UploadAttachment("example.zip", content)

// Send the email.
err := zm.SendMail("[email protected]", "Test subject", "This is a test email body!", &zohosendmail.MailAttachmentSlice{attachment})
To add multiple attachments.
err := zm.SendMail("[email protected]", "Test subject", "This is a test email body!", &zohosendmail.MailAttachmentSlice{attachment, attachment, attachment})

License

MIT

About

A small library to send a mail using the zoho.net mail api.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages