aliyun-sdk-go

module
v0.0.0-...-f523cfd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2020 License: Apache-2.0

README

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.

Directories

Path Synopsis
Package directmail .
Package directmail .
Package sms .
Package sms .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL