通过Appcelerator Cloud API发送电子邮件 [英] Sending email through Appcelerator Cloud API

查看:98
本文介绍了通过Appcelerator Cloud API发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的Titanium应用程序中通过Appcelerator Cloud Service发送电子邮件.我使用的代码是标准文档,在文档站点提供.但是电子邮件没有被发送.

I was trying to send email through Appcelerator Cloud Service, in my Titanium app. The code I'm using is the standart one, given at the documentation site. But the email is not being sent.

Cloud.Emails.send({
    template: 'welcome',
    recipients: '*******@gmail.com'
    },
    function (e) {
        if (e.success) {
        Titanium.API.info('Email sent successfully.');
    } else {
        Titanium.API.info('Error:\\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

出现此错误,未找到欢迎使用电子邮件模板".我当时以为模板就是要通过电子邮件发送的消息. API没有关于此属性(模板)的帮助.有人可以向我解释吗?我会很感激的.

It give the this error, 'Email template welcome is not found'. I was thinking that template is the message to be sent in email. There is no help on API about this attribute , template. Can anybody explain it to me? I'll be thankful.

感谢

推荐答案

该错误表明您尚未在ACS网站上创建电子邮件模板.以下步骤将帮助您创建电子邮件模板

The error shows that you haven't created an email template on the ACS website yet. The following steps will help you to create email template

  1. 登录到您的Appcelerator应用程序控制台
  2. 在您正在使用的应用程序下单击管理ACS"
  3. 点击电子邮件模板"标签
  4. 创建电子邮件模板".

您还可以按照以下步骤设置SMTP设置,该设置对我有用.

also you can setup your SMTP settings as follows which worked for me.

用户名: _ __ _ ____ @ gmail.com 密码:gmail帐户密码 TLS:true/false(均可使用) SMTP地址:smtp.gmail.com 端口: 587 域:www.gmail.com

Username: ________@gmail.com Password: gmail account password TLS: true/ false (both will work) SMTP Address: smtp.gmail.com Port: 587 Domain : www.gmail.com

这篇关于通过Appcelerator Cloud API发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆