调用单一发信 API 示例 (如何调用此接口,请参见 SingleSendMail ):
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Dm.Model.V20151123;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "<your accessKey", "<your accessSecret>");
IAcsClient client = new DefaultAcsClient(profile);
SingleSendMailRequest request = new SingleSendMailRequest();
try {
request.AccountName = "控制台创建的发信地址";
request.FromAlias = "发信人昵称";
request.AddressType = 1;
request.TagName = "控制台创建的标签";
request.ReplyToAddress = true;
request.ToAddress = "目标地址";
request.Subject = "邮件主题" ;
request.HtmlBody = "邮件正文" ;
SingleSendMailResponse httpResponse = client.GetAcsResponse(request);
} catch (ServerException e) {
e.printStackTrace();
}
catch (ClientException e) {
e.printStackTrace();
}
}
}
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。