Home » actionscript 2.0, actionscript 3.0

Mailto in Flash Actionscript

21 July 2009 No Comment

We can send mail directly using SMTP+Actionscript3.0 but here we are going to discuss about simple form of “mailto” function that just opens the default mail application with the supplied subject and body content.

Difficulty:
Beginners – intermediate

Version:
AS2 and AS3

Here we are going to see how to use mailto function in AS2 and AS3.

Mail to function in Actionscript

actionscript2.0

Step1:

Open New Flash Document (File > New) from menu or (CTRL + N) shortcut

key.Select Flash File (actionscript2.0)

Step2:

select the first keyframe on the layer1.

Step3:

Press F9 (Function key) or open the Actions Panel under the Windows menu.

Step4:

Paste the below code

getURL("mailto:designscripting@gmail.com?subject=Test Message&body=Site link: http://www.designscripting.com");

Step5:

Save your work and CTRL + ENTER to run the flash

You will see default mailing service with the mail address, subject and body

content.

actionscript3.0

Step1:

Open New Flash Document (File > New) from menu or (CTRL + N) shortcut key.

Select Flash File (actionscript3.0)

Step2:

select the first keyframe on the layer1.

Step3:

Press F9 (Function key) or open the Actions Panel under the Windows menu.

Step4:

Paste the below code

var email_str:String = "mailto:designscripting@gmail.com?subject=Test Message&body=Site link: http://www.designscripting.com";
var _request:URLRequest = new URLRequest(email_str);
navigateToURL(_request, "_blank");

Step5:

Save your work and CTRL + ENTER to run the flash

You will see default mailing service with the mail address, subject and body content.

Thats it we are one click away to send email… from Flash actionscript

Cheers :)

VN:F [1.7.7_1013]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.7_1013]
Rating: 0 (from 0 votes)

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.