imaxinant

Q: MailMessage not available?

Hello!

 

I try to send a message from an iBook Author Widget ussing iAd, with iAd.MailMessage.

I preview it on the device (an iPad 3) within a Gmail account but I get the message that MailMessage is not available.

 

This is the button code:

 

this.onViewActivate = function (event) {

 

    var nome = this.viewController.outlets.nome;

    var correoProfesor = this.viewController.outlets.correoProfesor;

    var resposta = this.viewController.outlets.resposta;

 

    if (!nome || !correoProfesor || !resposta) {

        alert('You must enter all data);

    }

    else if (!iAd.MailMessage.available) {

        alert('You must have an Email-enabled account on this device to send a message.');

    }

    else {

        // show the composer sheet

        var mensaxe = new iAd.MailMessage({

            to: [correoProfesor],

            subject: nome,

            body: resposta,

            html: false

        }, this);

        mensaxe.presentWhenReady();

    }

};

 

Always prints "You must have an Email-enabled account on this device to send a message."

 

Please, could anybody tell me what am I doing wrong?

 

Thanks in advance!

iPad 3G, iOS 7.1.1

Posted on Jul 30, 2014 10:26 AM

Close

Q: MailMessage not available?

  • All replies
  • Helpful answers