Sending email through Appcelerator Cloud API

你说的曾经没有我的故事 提交于 2019-12-12 18:46:53

问题


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)));
    }
});

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.

Thanx


回答1:


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. Log in to your Appcelerator App Console
  2. click "Manage ACS" under the app you're working on
  3. click the "Email Templates" tab
  4. "Create an Email Template".

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

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




回答2:


That error means you haven't created an email template on the ACS website yet. Log in to your Appcelerator App Console, click "Manage ACS" under the app you're working on, then click the "Email Templates" tab, and "Create an Email Template".



来源:https://stackoverflow.com/questions/12453794/sending-email-through-appcelerator-cloud-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!