Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Contributor
appsbychris
Posts: 11
Registered: ‎01-17-2013
My Carrier: Verizon

Opening Email Client on BB10

So it seems the BB10 dev alpha simulator does not have an email client.

I have search around, and believe i have the correct code to invoke it, but i want to be sure before i submit my app.

 

This is the code im using (This is a javascript/html5 app)

 

sendBlackBerryEmail: function(subject, body, to) {
		blackberry.invoke.card.invokeEmailComposer({
			subject: subject,
			body: body,
			to: to
		}, function (done) {
			console.log(done);
		}, function (cancel) {
			console.log(cancel);
		}, function (invokeError) {
			console.log(invokeError);
		});
	},

 So is this the correct way?

Please use plain text.
Contributor
fmbois
Posts: 15
Registered: ‎08-27-2011
My Carrier: SFR

Re: Opening Email Client on BB10

Javascript is not a typed language, depending on parameter types when you call 

function(subject, body, to)

 

it may work and may not. I used the following in my app (not approved yet). Hope this helps:

		blackberry.invoke.card.invokeEmailComposer({
			subject: "this subject is a string",
			body: "body is a text string",
			to: ["emailRecipientsIsAArrayEvenItHasOnlyOneElement@hotmail.com"]
		}, function (done) {
			console.log(done);
		}, function (cancel) {
			console.log(cancel);
		}, function (invokeError) {
			console.log(invokeError);
		});

 

 

Please use plain text.
Contributor
appsbychris
Posts: 11
Registered: ‎01-17-2013
My Carrier: Verizon

Re: Opening Email Client on BB10

Cool, i am passing in vars of the right type.

So i will send it off and update it later if it doesn't work.
Please use plain text.
Developer
nunodonato
Posts: 313
Registered: ‎03-28-2012
My Carrier: TMN

Re: Opening Email Client on BB10

just make sure the "to" is an array of strings, not just a string :smileyhappy:

Nuno
theBBthing.wordpress.com - my BlackBerry development blog: news, tips and tutorials
bitoutsidethebox.com - re-imagining digital solutions


Please use plain text.