Sending Email from Flash (mailto:)
Sooner or later, you’re going to want to send email from your SWF. There are at least two basic ways to accomplish this goal: the mailto: protocol and a server-side form mailer. Between the two, the server-side approach is the safer bet. The reason is because mailto: requires that the user has email software installed — and that this software be configured as the user’s default email handler. For most home and office users, this might be Outlook, Outlook Express, Thunderbird, Eudora, etc., the list goes on. Using mailto: in Flash is essentially no different from using mailto: in the href attribute of an anchor tag (a element) in HTML. It’s certainly an acceptable enough approach, but keep in mind, many people access the Internet through their local library, which means they may not even have email software installed, much less configured for personal use. So, now that the disclaimer has been stated, let’s see how to use mailto: in cahoots with getURL() to send email from Flash.
An answer, short and sweet
Assuming you want to trigger your email from a button, give your button an instance name via the Property inspector — here, we’ll call it btnSendEmail — and enter the following ActionScript in a frame of your scripts layer:
btnSendEmail.onRelease = function() {
getURL("mailto:name@domain.com");
};
How it works
The heart of the matter is that single line in the middle …
getURL("mailto:name@domain.com");
… which launches the user’s email software. The HTML equivalent does the same thing:
<a href="mailto:name@domain.com">Send email!</a>
The getURL() function requires at least one parameter. This parameter is a string, hence the quotation marks, and is perhaps most often used with the http: protocol to send the browser to another URL. Well, mailto: happens to be another protocol Flash supports, and its purpose is to handle email. Pretty painless, huh?
Don’t forget to replace name@domain.com with the actual email address desired.
Pushing the envelope
Couldn’t resist the pun. Get it?
Okay, if you want to get sophisticated, you can actually pre-populate the user’s email with additional information, such as a subject line or even a message in the email body. The above disclaimer applies all the more now, because not all email software supports what I’m about to show. But what the heck, right? Let’s see what the possibilities are, and I’ll leave it up to you to decide where and when to use them.
Note! Almost a year after writing this article, it came to my attention that the extra parameters here — cc, bcc, subject and body — stop working after Flash Player 7 in locally played SWFs. Starting with Flash Player 8, only the to: field is properly filled in unless tested in a browser. I‘m leaving the rest of the article for historical purposes, but take heed. Thanks, Anton, for bringing this to my attention!
Additional information can be attached to the mailto: content in the form of a query string with name/value pairs. These name/value pairs appear in the format name=value and are separated by an asterisk (&). So, the mailto: line appears as before, then you follow with a question mark, then your name/value pairs. For illustrative purposes, I’m putting certain parts in bold, just so they show up better.
Email with carbon copy (CC)
getURL("mailto:bill@excellent.com?cc=ted@excellent.com");
Email with blind carbon copy (BCC)
getURL("mailto:bill@excellent.com?bcc=ted@excellent.com");
Email with both CC and BCC
getURL("mailto:bill@excellent.com?cc=ted@excellent.com&
bcc=rufus@future.com");
Email with subject
getURL("mailto:bill@excellent.com?subject=
Strange%20things%20are%20afoot%20at%20the%20Circle%2dK%2e");
Whoa, what’s going on in that last one? Shouldn’t that simply say “Strings things are afoot at the Circle-K”? What are all those %20s? You may have seen similar formatting in query strings elsewhere, such as the address bar of a browser. %20 happens to be a hexadecimal number. In this case, the % indicates “Hey, this is hexadecimal,” and the 20 indicates 32 in the decimal system. In other words, this is what we humans call “number 32,” which happens to represent the space character in urlencoding.
It’s a good idea to urlencode the subject and body parts of your mailto: messages. Certain punctuation — such as spaces, question marks, and ampersands, for example — or other special characters might break your messages, otherwise. You can do it by hand, by using this urlencode chart, or you can use ActionScript’s handy escape() function as follows:
getURL("mailto:bill@excellent.com?subject=" +
escape("Strange things are afoot at the Circle-K."));
Note that the mailto: string terminates at subject=. We use the addition operator to concatenate the return value of escape(), which is supplied with its own string.. All of this is wrapped inside the parentheses used by getURL().
You can even include input from the user this way. Assuming a text field with the instance name tfBody, you could expand that last subject example to include body text as well. Watch carefully to see that we’re still ultimately using name/value pairs. In this past example, the query string begins with the question mark, as always, then contains a subject and body component separated by an ampersand.
getURL("mailto:bill@excellent.com?subject=" +
escape("Strange things are afoot at the Circle-K.") + "&body=" +
escape(tfBody.text));
June 19th, 2006 at 11:42 am
Thanks for the explanation — I hadn’t thought of using the escape() function in the getURL mailto: calls before. That makes it much easier.
June 19th, 2006 at 11:57 am
ImagicDigital,
escape()is one of those useful features that often slips notice. I almost forgot it here, myself. Thanks for your correction, by the way! I updated the article to reflect the error you caught.June 27th, 2006 at 1:05 am
thanks for a nice expalination on using mailto within Flash. that was exactly what i was looking for.
most of the links out there focused on PHP only. So i really appriciated how you presented the big picture and then focused on one (mailto). it is more informative this way.
thanks again
June 27th, 2006 at 7:05 am
Fawzi,
You’re welcome! I can’t stress enough that PHP (or ASP, or some other server solution) is the most reliable way, but
mailto:works in a pinch. Glad it was helpful to you.July 25th, 2006 at 5:59 pm
Thank you for this example it has been very helpful. I do have a question though. I seem to be running into a character limit within the body of my e-mail (about 120-130). Is there a way around this?
thanks,
Ron
July 26th, 2006 at 9:06 am
Ron,
I was hoping to have a definitive reply to your question. I Googled a bit and found very little in the way of authoriative data. Then I thought, “Gosh, it shouldn’t be hard to just test this,” so I did — and I got a much higher character limit in the body of my email. I had a hunch that the total number of characters, for address, CC, subj, etc., including body, might be 256, or that the character limit for each might be that much, but that wasn’t the case on my machine.
I went with 256-character strings, adjusting in the case of addresses (251 plus ampersand [@], dot [.], and “com”), and found that I could pack a huge email address, a number of CCs, and a 1,024-character body without losing any data. For all I know, I could have succeeded with more.
Apparently, character limit depends on a user’s particular configuration, which is probably another caveat against using this approach.
August 27th, 2006 at 5:30 pm
I’ve been building a simple order form using this and have run into a 1297 character limit in the body on Entourage X on a Mac - what email programs are you on?
Thanks,
Douglas
btw, that urlencode chart was gold - I couldn’t find anywhere up until there how to put in a return into the body.
August 27th, 2006 at 8:22 pm
Douglas,
Wow, that blows! I’m using Outlook on WinXP. It doesn’t surprise me there’s a limit — that’s part of why server-side is the safer bet — but I’m sorry someone hit a limit so soon.
Glad you like the chart, though.
I use that all the time.
September 5th, 2006 at 6:44 am
I have to use mailto function for a part of a text.how it can be done
September 5th, 2006 at 7:28 am
kumaresh,
Double-click your text field to enter it. Select the word or words you wish to make into a hyperlink. Enter
mailto:user@domain.cominto the URL Link field (bottom center) of the Property inspector. Either that, or render the text field as HTML and assign a traditional<a>tag to the text field’shtmlTextproperty.September 15th, 2006 at 11:12 pm
Hi is it possible to pre-populate the user’s email with a jpeg? Thanks.
September 18th, 2006 at 9:33 am
Carol,
That’s an interesting question. I just toyed a bit with using HTML code as the body text. I haven’t yet been successful, but if there’s a way to do it, my guess is, that would be the way: use an image tag (
<img>) to embed an absolute path.September 27th, 2006 at 11:22 am
David,
You mention two different methods: mailto and server-side. I have already used the mailto, but for the exact reasons you explain here, I’m interested in using the server-side method. Is there somewhere that you explain how to use the server-side method?
L. Jay
September 28th, 2006 at 12:36 am
L. Jay,
Your question is a good one. Sooner or later, I’m sure I’ll take a swing at it, because it’s certainly worth an article of its own. In the mean time, check out this tutorial at kirupa.com …
http://www.kirupa.com/web/form_mailer.htm
That handles the server-side part (assuming you have PHP). Next, instantiate the
LoadVarsobject in Flash and add new properties to your instance.Finally, invoke one of the send methods of that class (
send()orsendAndLoad(); see the ActionScript 2.0 Language Reference for details). That performs essentially the same action as a<form>submit in HTML.November 22nd, 2006 at 5:40 pm
Hi, thanks for all your info. But do you know if I can use mailto: to send a Link field, i.e. text that can be clicked from the email body and connect directly to a website.
Thanks so much.
November 27th, 2006 at 2:53 am
Carmen,
Assuming the recipient of your email can accept HTML-encoded messages, you would have to construct the necessary HTML (presumably an anchor tag [
<a>]) and put that inside a urlencoded string, like the Email with subject example above. Many email clients automatically hyperlink URLs and other linkable text, like FTP and email addresses, so you may not have to do anything special at all — just make sure you urlencode any special characters in your string: e.g., if you’re trying to send the string “http://www.somedomain.com,” make sure to take care of the colon and those slashes.November 30th, 2006 at 7:45 am
Dear David the explaination is so good. I have a doubt can you please check it. I want to display a string which contains all the HTML tags in Mailto body as normal text how can i do that. can you help me out to solve this problem..
Thanks & regards
Srikantha
November 30th, 2006 at 12:41 pm
Srikantha,
The approach described above is identical to the approach you might use with an HTML
<a>tag. As far as I know, this technique is only capable of passing through text. I haven’t figured out a way to pass in HTML, which I tried after my response to Carmen (just above your comment).December 6th, 2006 at 8:41 am
David, great article. Thanks!
I tried your example to include body text:
getURL(”mailto:bill@excellent.com?subject=” +
escape(”Strange things are afoot at the Circle-K.”) + “&body=” +
escape(tfBody.text));
Works well. Thing is, though I used the “render text as HTML” option in the Property inspector, I can seem to get my body copy to format. How can I format “tfBody” for the user?
TIA,
Dan
December 6th, 2006 at 12:12 pm
Dan,
Ah, that “render text as HTML” setting only applies to text fields inside the SWF, as it turns out. Flash supports a minor subset of HTML, and that setting allows you to format words in bold, italic, and the like, while in Flash. It has no bearing on the string you append to your
mailto:reference. After some experimentation, I’m afraid I haven’t figured out a way to nudge my email client into accepting urlencoded HTML as HTMLDecember 6th, 2006 at 11:37 pm
Thanks for trying, David.
Worthy pursuit.
Cheers,
Dan
December 10th, 2006 at 2:32 pm
Hello,
That was exactly what i was looking for. It workes perfect when i have it solo in flashdocument. But if i use it in flash in another mc (that was loaded in another external movieclip) it only fills in the mailto recipient.
This is the code i use.
btnSendEmail.onPress= function () {
getURL(”mailto:contact@versible.be?subject=” +
escape(”Add me to the mailinglist”) + “&body=name: ” +
escape(this.tfBody.text)+”%0A mail: ” +escape(this.tfMail.text) );
gotoAndPlay(”normal”);
;
};
Why? Can u help? thx a bunch.
karel
December 10th, 2006 at 3:11 pm
karel,
You’ve got to consider what the global
Is there a
thisproperty refers to whenever you use it. Pathing is extremely importing in any programming language.this.tfBodyin your other movie clip? What doesthisrefer to in this context? It might be the button itself — is this button actually a movie clip?It’s often not possible to copy one bit of code and simply paste it somewhere else. You might want to
trace()your various objects as described in my debugging article to see what’s going on.December 11th, 2006 at 6:18 am
Sorry.
I forgot to remove those thises. My problem actually is now different.
It works when I preview from flash but doesn’t when i test from a browser or the swf with flashplayer.
thx thx
karel
December 14th, 2006 at 2:57 am
karel,
I’m afraid that doesn’t give me much to go on. Have you checked out that debugging article?
January 5th, 2007 at 6:08 am
Hi,
I have hit a problem that judging by this tutorial you might be able to help me on. I have mailto links in my flash document with subject and body text. When I test on a machine using Thunderbird everything is fine but if I test on a machine with outlook the subject line and body field are blank. I have tried to urlencode them but they remain blank.
Thanks for having a look and any help you can give
January 8th, 2007 at 8:43 am
Ben,
It’s tough to answer this one, because I don’t fully know your circumstances. Keep in mind, the approach described in this blog entry is only as useful as its HTML equivalent (
<a href="mailto:…). It may be that you have both Outlook and Thunderbird installed, and Thunderbird is your default. Maybe that’s the reason. It may be you accidentally mistyped something? It may be the particular version of Outlook you have (not especially likely, but who knows?).Have you tested the same thing via HTML? Do you get the same results?
January 17th, 2007 at 2:00 am
Hi to all,
i used mailto. but i have one problem that i cant send mail with more than 256 character. if anybody have solution than plz send me immediatly.
tanks to u all,
jiten
January 17th, 2007 at 9:14 am
Jiten,
The solution — especially given so many characters — is to go with a server side approach, such as a standard PHP or ASP form mailer.
February 16th, 2007 at 12:19 pm
We have had similar problems with mailto: and getting subject, body or anything else to fill in. The flash program we made worked for awhile then stopped filling in the subject and body. I have found hundreds of other examples of this online that have the same problem but no one has a fix. I have even cut and pasted your code and 30 to 40 others and they do the same thing. I have tried multiple systems and multiple computers and no thing works. I should be able to create a new project, create a button, attached your code and have it work, but that is not the case. The interesting part is that although there are hundreds of cases online, Adobe doesn’t list any on their support site.
Any help would greatly appreciated
Flash 8 Pro
February 16th, 2007 at 12:30 pm
David,
Adobe doesn’t do anything about this because it is not — it cannot be — an Adobe problem. The
getURL()function effectively emulates the<a>element in HTML. In HTML, you can use the very same technique to try to automatically fill-in the user’s subject line and body, but whether it works depends entirely on the user’s configuration.What email software, if any, is installed on the user’s machine? Has it been configured as the default email software? Sure, most people may have Outlook, but many do not. Most people may have some flavor of Windows, but many do not.
You can reproduce this issue with HTML alone, without using a single Adobe product. Indeed, Adobe doesn’t make email clients, and it’s the email client that decides how to interpret the suggested code above.
The solid way to handle this, for sure, is to use a server-side form mailer and bypass the need to use email software in the first place.
March 21st, 2007 at 3:49 am
Hi David,
I do not want to evoke any email sending software as outlook, lotus notes, etc. When the user fill the email form and click send it should come to me.
What should do to get that functionality?
Regards
March 21st, 2007 at 7:41 am
Basith,
For that, you need a server-side form mailer. Here’s a Kirupa.com email form tutorial.
April 1st, 2007 at 10:42 am
Thanks for your help. Me and a friend are working on a site and we are just learning flash as we go and this helped a lot. Thanks……
April 6th, 2007 at 10:17 pm
Great lesson, well done. I have tried the PHP approach, but unfortunately my ISP doesn’t support PHP. So your approach with mailto: solved the problem. But could you answer a quick question?
I have four variables in my Flash document to look after the user’s name, email address, company, and message. The button I am using to activate this is in it’s own movie clip, and the email fields are in another clip.
No problems with this, but I can’t get a word space between the various variables - what I get is WarrenCompanyMyemail@ISP.comTHis is the
bodytext.
on(rollOver){
gotoAndPlay(2);
}
on(rollOut){
gotoAndPlay(11);
}
on (release) {
getURL(”mailto: butts@myisp.com” + “?subject= website enquiry” + “&body=” + _parent.t1 + _parent.t2 + _parent.t3 + _parent.t4);
}
Could you help me put a simple space between these variables?
April 6th, 2007 at 10:56 pm
Warren,
The
%20encoding should do it.e.g.
getURL("mailto:butts@myisp.com" +"?subject=%20website%20enquiry"+ "&body=" + _parent.t1 + "%20" + _parent.t2 +etc.April 6th, 2007 at 11:07 pm
Well David, I feel not unlike an idiot. How damned simple was the answer. I guess when you’re too close to the subject, the obvious becomes blurred.
Thanks very much, you’re a champion.
April 12th, 2007 at 1:42 am
ok, sorry! i worked it out,
Cc & subject work like this:
on (release) {
getURL(”mailto:amber@xxxxxxx.au?cc=amber@xxxxxxxxxx.au&subject=Enqiry%20Website”);
}
thanks anyways! great site!
April 13th, 2007 at 7:56 am
Amber,
Thanks!
April 17th, 2007 at 12:24 pm
Hi David, thanks for the escape tip! I am however experiencing a problem that the subject and body does not populate with the info. To view this for yourself run:
on (release) {
getURL(”mailto:someone@somwhere.co.za?subject=Test Subject&body=test”);
}
from the projector and hopefully you will see that one the address gets populated. Now, when run under IIS it sometimes happens that it does the same. Any suggestions?
April 17th, 2007 at 7:48 pm
Anton,
Wow, good eye! Not only are the subject and body omitted, but so are cc and bcc — at least, on my machine. I was absolutely sure this worked in the past, so I started testing in older versions of Flash Player. At Flash Player 7, it started working again. Isn’t that odd? When I wrote this article, Flash Player 8 was already in full swing, but I must have been testing 7 when I blogged this last June.
I’m updating the article now!
[Note: This seems to be an issue on local machines only; that is, SWFs tested from the Flash IDE or in Projectors, but not SWFs tested in Flash Player as embedded in an HTML page.]
April 18th, 2007 at 5:10 am
Hi David,
Is there any possible solution to this or is this how the player is configured? Would appreciate if anyone can help with possible solution.
May 10th, 2007 at 6:25 am
If the subject and body are omitted when testing locally it could be because of flash 8’s security settings.
I found a solution here:
http://www.flashpearls.com/archives/2005/10/mailto_subject.php
Quick access to the security panel here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
cheers.
May 20th, 2007 at 1:22 pm
Just to say a big thanks… I was trying to make flash send email in the form “My name “, but it didn’t work… until I read your article and used the escape() function. thanks!
May 29th, 2007 at 10:05 am
To Anton and Jake …
Jake, thanks for the insight on a probable difference between locally and remotely displayed SWFs. Anton, my only suggestion at this point would be that you try a 3rd party Projector enhancer, such as Zinc or Jugglor. I don’t know for sure that either of those would guarantee you the control you’re looking for — success is also dependent on the user’s installed email softare, if available — but certainly worth a shot.
To Hugo …
Glad to hear it! You’re welcome.
June 19th, 2007 at 11:22 pm
Dear David:
I searched and searched and searched for a way to make my mailto: work, but to no avail. Luckily, I bumped into your Blog. Your “Short and Sweet” answer worked like a dream.
I thank you, very…very…very…much,
Kat
(My site “Kat’s World” is still under construction, and to be launched soon.)
I also would like you to know that I enjoyed viewing your Portfolio/Resume. Especially the section under Documentation where you encourage website designers to have “Well commented code” a rule I will try my utmost to implement. Thanks again.
June 20th, 2007 at 8:06 pm
Kat from Kat’s World,
Wow, what a cool compliment (the documentation note)! Thanks so much, and you’re certainly welcome for the help! Glad I could be of service.
June 27th, 2007 at 12:28 pm
Very nice description of the problem with the %20, the escape() function was a nice addOn to my skills. Thx for your work!!
June 27th, 2007 at 9:59 pm
Jorge,
Thanks!
June 29th, 2007 at 8:19 am
Only the TO address is getting filled up in my system. The subject and body are not getting filled up. Im using Outlook Express and Flash8 Professional. If there is any other way or sustitutes please inform me. I need it terribly.
July 4th, 2007 at 1:46 pm
Sumesh,
Some readers have discovered that not all the fields work all the time, and I did some preliminary testing that led me to believe the rules changed in Flash Player 7. That may not actually be true, because I didn’t test from an online SWF, only from a SWF off my local machine. Make sure to test your SWF as embedded in a web page on a server.
August 1st, 2007 at 4:14 pm
Hi! I think I’ll leave the compliments aside, the other users did that for me too
Still, I do have a problem with this mailto: script. I have a mail “button” and I applied the exact same code (on a frame). Still, it doesn’t work. I’m testing it from my PC but it doesn’t work. On that button I do have some more code written, but I don’t think it has any effect on the mailto: action. Any ideea why it might not work? I read all the comments and didn’t find my answer in any of them .. I also tried working with the debugger, same result: the Outlook won’t open.
Thanks in anticipation and excuse my english, I’m not english
August 1st, 2007 at 4:19 pm
Hey there David.
This is great, I was having trouble finding something that wasn’t requiring me to build a flash based email form (which I don’t want to do).
One problem though. I am using flash 8, action script 2 and when I press the button and invoke the “mailto” it launches the email program, but it also launches a blank page in my browser.
How can I stop this last browser action?
August 6th, 2007 at 7:33 am
To sktes …
In most respects, using the
mailto:protocol in Flash is the same as usingmailto:in HTML, so if it works on your machine in an HTML document, you should be in luck. Are you possibly using ActionScript 3.0 in Flash CS3?To Richard …
Interesting. I tested again on this end, just to make sure. I don’t get a blank browser page at all … not when testing locally or when requesting from my server. Did you provide the optional second parameter, maybe, and specify “_blank”?
August 30th, 2007 at 1:01 am
Hi David
I’m experiencing the same problem Richard Belotte mentioned August 1, where I get a
blank browser page popping up as well as the email window, same setup actionscript 2,
I was wondering if a solution or reason for this came to light?
Thanks
August 30th, 2007 at 2:32 am
Hi David
I’ve found the cause of the problem with the extra blank browser page popping up, in my case it was just my inexperience, I was testing the flash file not from within a html page,
inside it’s published html page it works fine.
Thanks Again for the informative blog.
August 30th, 2007 at 6:34 am
Does anyone know if it is possible in Flash/html or Java to get a mailto link to insert images(jpeg) into a mail aswell as the recipient and subject. I have found html code which allows you to insert text into the body of the email but not an image. Any help on this would be great.
August 30th, 2007 at 11:44 am
To Marcus …
There you go! Good deal.
Glad to hear the blog is helpful to you.
To Barry …
As far as I know, your endeavor isn’t possible, not unless the email is generated on the server. In other words, if you used a form mailer (the recommended route), you can do what you’re after. Of course, even so, pictures would only show for people with image-capable email clients and with HTML formatting turned on.
September 13th, 2007 at 10:11 am
David,
I’m trying to get this to work in a Flash I’m developing. We want users to be able to send a link to the page containing the movie to a friend. So we want it to open an email with the “to” address blank, but the subject and body filled in.
I’ve gotten the basic code you suggested to work (although for some reason it opens two emails, one with just the to address, the other with both the to and subject filled in. I can’t get the body to work, and I can’t figure out how to leave the to field blank.
Any suggestions?
September 13th, 2007 at 10:39 am
Aha. I found the code that was buried from a previous attempt to manage this. My fault.
Thanks again for the tip. I’m all set now.
BTW… I found that this worked even in the “test movie” mode. Using Flash CS3.
September 25th, 2007 at 5:16 am
Just wanted to say thanks, great blog with well focussed, easy to understand info on a subject which should be simple but generally is not.
I spent ages looking on Adobe support pages - without mention of mailto, so finding your blog was magic!
September 25th, 2007 at 7:33 am
To Andrew …
Sorry for the delayed reply! I was out to Flashforward all last week, in Boston. In any case, it looks like you managed just fine!
Glad you found a solution.
To Tony …
That’s encouraging! Thank you.
October 12th, 2007 at 10:42 am
hey! I’m new to this. but could i by any chance have the actual flash project on how to send an e-mail. thank you very much.
I want to be able to send an email. using flash 9 actionscript 2.0 thanks again
October 12th, 2007 at 12:19 pm
hey. any time i try doing this it would open outlook or mail (on a mac) I would like to send an email without going to go to outlook. thanks a lot
October 12th, 2007 at 1:11 pm
To xavier …
I could provide you with a FLA document if you really need it, but I think you’ll get more out of it if you just do it yourself. Here are the steps:
btnSendEmail. Now that you have an instance name, you can speak to that button with ActionScript.That’s all there is to it.
To don …
Exactly. This approach, from a practical standpoint, mimics its counterpart in HTML (
<a href="mailto:..." ... >). To send email without opening the user’s default email client, you’ll have to use a server-side solution, such as this PHP approach:PHP Mail Form
Flash Based Email Form Using PHP
November 1st, 2007 at 6:25 pm
Hi there,
Great post, you explain things in a very easy to understand way. I have a flash file requiring an email link which i have working (in flash cs3 actionscript 3.0), however when the link is clicked in ie 6+ then it opens up a new (and unwanted) window. is there a way to avoid this?
code:
link_btn.addEventListener(MouseEvent.CLICK,change_page);
function change_page(e:MouseEvent):void
{
navigateToURL(new URLRequest(”mailto:info@website.edu?subject=SUBJECT&body=Enter your name:%0A%0AEnter your email or phone number:”));
}
Would love the help.. cant find much out there on this topic!
November 23rd, 2007 at 2:50 pm
hi folks, i got that same problem, the subject field has not been filled, but in the web-server it worked!
thanks…
December 6th, 2007 at 9:59 am
Great info very very helpful! Im having the problem of character limit in Lotus Notes…I only seem to be able to get 144 for the body…anymore than that and Lotus notes wont open the email…anyone else with Lotus Notes confirm this for me….thanks a bunch
B
December 14th, 2007 at 10:55 am
To Nigel …
Is it doing that even when the SWF has been uploaded to your server? isaque notice that the problem went away from tested remotely.
To isaque …
For better or worse, that’s likely a limitation that can’t be avoided.
To Brian …
I’ve never used Lotus Notes, so I can’t help you on this one. :-/ Here’s hoping other readers can!
December 31st, 2007 at 9:59 am
hi every one big ups i have a problem making a tell a friend form
i make the form in flash cs3 but i need the proper script to go with
the submit button, i would like when my visiter click the submit button
the email is sent using the email address the user input in the friends
email field could some one shed some light on this or email me the proper script thank you in advance (rickey@superjamaica.com)
January 7th, 2008 at 8:53 am
Hi, rickey,
If you’re familiar with PHP at all, you should be able to convert a regular PHP form handler — the kind that sends an email to you (rather than a friend) — to the sort you need. You’ll just replace the To: field with a variable sent from the SWF.
I did find quite a few “tell a friend” scripts via Google. I happen to like PHP, but any server-side scripting language will do. If you can submit to a script from an HTML page, Flash will be able to do the same. Here’s a free one that came up near the top of my search list:
Softpedia’s Tell a Friend PHP Script 1.01
January 7th, 2008 at 5:44 pm
Hi David,
Is it possible for “mailto” to function in flash only? as well as .exe ?
I’ve tried the coding you given here but the outlook express doesn’t appear
when i test movie in flash.
Please help me !!
Thanks in advance, appreciate your sharing
Cedric
January 8th, 2008 at 1:34 am
Cedric,
Alas, the short answer is no.
What you’re calling a function (mailto) is actually a protocol, like the http protocol used in browsers. The explicit mention of a given protocol tells the operating system how to interpret the data that go with it — in this case, an email address and possibly additional email-related information. Flash Player simply isn’t an email client, which is why it relies on the default email client (e.g. Outlook Express) installed on the user’s machine.
The mailto protocol in Flash works very much like the same protocol used in HTML documents. If you add an
<a>tag for the same email address in an HTML page, does the hyperlink open your email client?March 5th, 2008 at 12:51 pm
Hi I am working with flash 9 and actionscript 3.0
I am trying to find a way to have email sent from my flash site to myself. Has nything been done about this or am I simply confused ….possible the later
thanks
EDK
August 17th, 2008 at 1:58 am
Hi,
When I use the mailto command in Firefox, it works just fine, but when I use Explorer, it opens the e-mail form properly, but also brings up an extra Explorer window, with the mailto command in it’s address bar, that says:
Navigation to the webpage was canceled
What you can try:
Retype the address.
So people can still send me an e-mail, they just get this extra page opening up with an error. It looks unprofessional. Any idea why this is happening?
May 1st, 2009 at 6:00 pm
Very helpful stuff, David.
May 1st, 2009 at 6:07 pm
Hey David. Great tutorial thanks.
I have a question regarding how to incorporate a URL click through into the &body of the message, so that the message contains a clickable URL for the receiver of the email to go to a certain website.
Also, I have been unable to create a line break in the &body. I have tried newline, , .
great job
Forrest