Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How Do I Use a Flash Button to Open an Email Client and Pre-fill Subject and Body?

Posted on 2007-12-31
6
Medium Priority
?
2,347 Views
Last Modified: 2008-03-29
My Flash (AS3) project needs to be able to open and send email from the user's client.  (We do not want to have a Flash form email as it could get abused.)

Subject and Body are preset by our system, not the user.  (Obviously, they could be edited.)

How can I make this work?

0
Comment
Question by:everettmarshall
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 20558351
try this..

on (release) {
      getURL("mailTo:someone@everettmarshall.com?subject=The subject&body=Some text here" );
}

Z
0
 
LVL 1

Author Comment

by:everettmarshall
ID: 20558653
on (release) {
      getURL("mailTo:someone@everettmarshall.com?subject=The subject&body=Some text here" );
}

That doesn't seem to work in AS3...but this kinda' does:

 function gotoURL1(event:MouseEvent) {
   var url = new URLRequest('mailTo:someone@everettmarshall.com?subject=The subject&body=Some text here');
   navigateToURL(url, '_blank');
 }

 s2f_btn.addEventListener(MouseEvent.CLICK, gotoURL1);


It opens the email client and fills Subject and Body.  I could live with this except any punctuation in the subject or body text (apostrophe) breaks the script.  Is there any way to allow the body to contain html?
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 20559064
Yes there is.
Z
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 23

Accepted Solution

by:
Zeffer earned 1500 total points
ID: 20560842
Understand that it's the browser that allows or disallows parameters..not flash..so if for instance javascript is blocked..then mailTo ..a javascript call.. will not work and you can use html..but only if the mail client is configured to allow it
Z
0
 
LVL 1

Author Comment

by:everettmarshall
ID: 20640514
This has become harder than I thought, so I'm increasing point value to 500 as I need a solution pretty quick.

The issue I'm facing occurs before ever getting out of Flash.  Entering the text I want to have populate the email body causes a break in AS3 code. Using html punctuation equivalent doesn't work.  How do I format the text I want to attempt to pass to the email client?

I'm not convinced that the existing code I have is correct, only that it has partial functionality.

What is the best way to accomplish what I am attempting?  (A button that opens the default email client and pre-fills Subject and Body.)

 
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 20641868
incidentally that code I gave you in the first post.. the swf needs to be in an html page to work..your code would work straight from the swf
also
I am now unsure that you can format the text going into the body..( I thought one could) I have searched extensively and nowhere (that I can find) is there a way to format the text with html.
I have looked at at least a dozen different sites on using mailTo and not one has any formatting of the text.. you might have to stick with plain text :(

Z
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question