Open email client and use HTML link
Copy link to clipboard
Copied
How does one open an email client and embed a body with HTML, so links will work.
I have tried:
var request:URLRequest = new URLRequest("mailto:someemail@somewhere.com?subject=some subject Results"+"&body="+"<A=href=3Dhttp://www.somelink.com</A>"
navigateToURL(request, "_self");
This is not to be sent to a php page, but load the user's Email Client.
Copy link to clipboard
Copied
What you tried should work when written properly and you should test in a browser. As shown, it is missing a closing parenthesis for the URLRequest definition, and the html link is not written correctly.
var request:URLRequest = new URLRequest("mailto:someemail@somewhere.com?subject=some subject Results"+"&body="+"<A href=\"http://www.somelink.com\">3D?</A>");
navigateToURL(request, "_self");
Copy link to clipboard
Copied
Thank you Ned. I did mess that up when I put it in this post.
However, yours does not work either.
When the email opens, it is in html as the Plain Text button option is there.
Do you see anything wrong with what you had in that request?
Copy link to clipboard
Copied
Using URL notation to specify an emails contents you can't force a user to use rich text. Some have their clients to default to plain text. Therefore it will just show the HTML. There is no guaranteed way to achieve this.
If the user has rich text set as default a link being injected typically auto-links anyhow. You may not SEE it as a hyperlink but send the email and the receiving users computer should see it as a hyperlink.
So try:
var request:URLRequest = new URLRequest("mailto:someemail@somewhere.com?subject=some subject Results&body=http://www.somelink.com");
Then send that email to yourself. You should see it appear as a hyperlink automatically, as long as you have rich text mode enabled. Otherwise no matter what you send a plain text user will never see your hyperlink anyhow as it strips HTML out.
Copy link to clipboard
Copied
Thank you as well sinious.
But that also did not work for me.
My email client receives html email fine but not when sent like this.
I have tried 2 different computers. They have the option to turn the email to Plain Text, meaning they are already in rich text.
Does the line you you supplied work for you? Or anyone else?
I understand about the not being able to force the user to use Rich Text. Thjat will not be a problem for this case.
Copy link to clipboard
Copied
Try something like this:
var urlStr:String = encodeURI("http://www.somelink.com");
var mailMsg:URLRequest = new URLRequest("mailto:");
var variables:URLVariables = new URLVariables();
variables.subject = "Some subject";
variables.body = urlStr;
mailMsg.data = variables;
mailMsg.method = URLRequestMethod.GET;
navigateToURL(mailMsg);
I've created requests like this on iPad and it works perfectly fine. Only real difference is encoding the URL. I receive links, not plain text.
Copy link to clipboard
Copied
Well, it seems that some email clients show it without the hyperlink regardless of if it is set to Rich Text.
Now, I am talking about the sending of the email here, not the receiving. So I will live with that.
However, I also get a blank browser page before it opens the email client. Is there a way to avoid this?
Thanks for the assistance.
Copy link to clipboard
Copied
Unfortunately no, you're asking the OS to open a browser by using navigateToURL. The browsers is the means by which you open the email so it must be loaded. Back in the day you could write some JavaScript to the browser that opens to trigger the email then close itself but browsers all prevent anything but child windows to be closed via JS.
You can't get at the raw data under the email with the simple URL arguments you can pass.
What is your context? Is this a flash website? A projector? AIR application? App?
Copy link to clipboard
Copied
Flash website app.
I am trying to avoid using a php script but might if need be.
Copy link to clipboard
Copied
The cleanest is always going to be making your own email via PHP. Then you can use the HTML.

