Skip to content

An easy way to use Aliyun DirectMail to send mails, and use Aliyun Short Message Service to send messages.

License

Notifications You must be signed in to change notification settings

Blank-Xu/aliyun-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aliyun-sdk

Go Report Card PkgGoDev License


An easy way to use Aliyun DirectMail to send emails,

use Aliyun Short Message Service to send messages.

Installation

go get github.com/Blank-Xu/aliyun-sdk-go

Simple Example

package main

import (
	directmail "github.com/Blank-Xu/aliyun-sdk-go/directmail"
	sms "github.com/Blank-Xu/aliyun-sdk-go/sms"
	
	"fmt"
)

func main() {
	// email
	directmailAPI := directmail.NewAPI(host, accessKeyID, accessSecret, regionID, version, accountName, fromAlias)

	code, body, err := directmailAPI.SingleSendMail(emails, subject, "", textBody)
	fmt.Printf("code: %d, body: %s, err: %v\n", code, body, err)

	// sms
	smsAPI := sms.NewAPI(host, accessKeyID, accessSecret, regionID, version)
    
	resp, err := smsAPI.SendSms(phones, signName, templateCode, templateParam)
	fmt.Printf("resp: %+v, err: %v\n", resp, err)
}

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

About

An easy way to use Aliyun DirectMail to send mails, and use Aliyun Short Message Service to send messages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages