Mailto in Flash Actionscript
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.

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









Leave your response!