Skip to content

xjdata/php-aliyun-open-api-dm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

The DM SDK for Aliyun OpenAPI

The DM SDK for Aliyun OpenAPI

基于Lokielse[https://github.com/lokielse/php-aliyun-open-api-core]

Install

Via Composer

$ composer require xjdata/aliyun-open-api-dm

Usage

/**
 * 访问信息
 */
$config = [
	'AccessKeyId'=>'<your access_key_id>',
	'AccessKeySecret'=>'<your access_key_secret>',
];

/**
 * 配置网关
 */
$endpoint = new Endpoint('cn-hangzhou', EndpointConfig::getRegionIds(), EndpointConfig::getProductDomains());
EndpointProvider::setEndpoints([ $endpoint ]);

/**
 * 授权资料
 */
$profile = DefaultProfile::getProfile('cn-hangzhou', $config['AccessKeyId'], $config['AccessKeySecret']);


/**
 * 请求对象
 */
$request = new \Aliyun\Dm\Request\SingleSendMailRequest();
$request->setAccountName("[email protected]");
$request->setFromAlias("某某");
$request->setAddressType(1);
$request->setTagName("youtagname");
$request->setReplyToAddress("true");
$request->setToAddress("[email protected]");
$request->setSubject("邮件主题");
$request->setHtmlBody("邮件正文");
$response = $client->getAcsResponse($request);
var_dump($response);

官方文档

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages