Skip to main content
Participating Frequently
May 6, 2012
Question

send html mail with navigateToURL(new URLRequest('mailto:

  • May 6, 2012
  • 3 replies
  • 3861 views

hi!

do you think its possible, to send html text to the email client of the mobile device?

i tried different ways, but without success.

Way 1

navigateToURL(new URLRequest('mailto:name@hotmail.com'+'?subject=Subject'+'&body= <html><body>Hello world<br><img src="http://www.republicofcode.com/wp-content/uploads/2012/04/Pins2_300_250.png"></body></html>'));

Way 2

var hdr:URLRequestHeader = new URLRequestHeader("Content-type", "text/html");
var request:URLRequest = new URLRequest('mailto:
name@hotmail.com?subject=Subject&body=<html><body>Hello world<br><img src="http://www.republicofcode.com/wp-content/uploads/2012/04/Pins2_300_250.png"></body></html>');
request.requestHeaders.push(hdr);
navigateToURL(request);

Maybe i need another content type than text/html?
In the reference i've read, that the default one is: application/x-www-form-urlencoded

http://help.adobe.com/de_DE/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html#contentType

Any ideas?

This topic has been closed for replies.

3 replies

Inspiring
May 7, 2012

you could try:

function submitPoll(e:MouseEvent):void {

  //sending the email stuff

  var request:URLRequest = new URLRequest("mailto:name@hotmail.com"+"?subject=Subject"+"&body= Hello world ");

  navigateToURL(request, "_blank");

  request.method = URLRequestMethod.POST;

}


painschenAuthor
Participating Frequently
May 7, 2012

your code is correct for sending a regular text by mailto (like "hello world").

but i would like send html text which will be displayed in the mail like <img src="..." /> <b> etc..

Inspiring
May 7, 2012