ali-mns icon indicating copy to clipboard operation
ali-mns copied to clipboard

能给一个发邮件的例子吗?

Open laotie1015 opened this issue 7 years ago • 0 comments

var account = new AliMNS.Account(accountId,accessKeyId, accessKeySecret);

        var emailBody = JSON.stringify({
          Action: "SingleSendMail",
          AccountName: "a*****y.com",
          ReplyToAddress: false,
          AddressType: 0,
          ToAddress: "l*****[email protected]",
          FromAlias: "****",
          Subject: "ceshi",
          TextBody: "ceshiyoujian",
          IsHtml: 0,
          ReplyToAddress: 0
        });
        var topic = new AliMNS.Topic("email-topic-cn-hangzhou", account, "hangzhou-internal");
        //topic.listP().then(console.log);
        //console.log(emailBody);
        var body = { DirectMail: emailBody};
        //console.log(XmlBuilder.create(body).toString());
        topic.publishP("test email", false, null, body)
              .then(console.log, console.error);

为啥还是报错: Message: 'The XML you provided did not validate against our published schema, cause by "DirectMail" Element.',

laotie1015 avatar Aug 23 '17 09:08 laotie1015