Type a valid email address in the to box, a message in the message box then click the send message button.

Get the FLA

 

How this works:

My ISP (Alentus.com) provide an ASP mailer object for the domains they host. You can't send an email from flash without having some sort of intermediary like this. The Flash application uses a getURL command which connects to a short ASP script I have placed in my own scripts directory. This script invokes my webserver's mailer object which actually sends the mail. You would need to find out from your own ISP if they provide any such function - if they do, you need to find out how to interface with it.

Alentus provided me with a sample form based ASP script that does a simple mail operation. I modified this script to create the script (PigMailSend.asp) that the Flash Application communicates with. The FLA is probably the simplest part of the whole chain.

The ASP script (PigMailSend.asp) is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<HTML>

<!-- --------------------------------------------------------------------------------------

PacificNetware Default Web Site

Page.......: ASP Mail Test Form

Domain.....: cleverpig.com

URL........: http://www.cleverpig.com/scripts/testMailForm.asp

Copyright 2000, PacificNetware.com Inc.

-------------------------------------------------------------------------------------- -->

<!-- HTML Header -->

<HEAD>

<TITLE>Welcome to www.cleverpig.com</TITLE>

<META name='keywords' content='cleverpig.com,www.cleverpig.com'>

<STYLE>

<!-- body { font-family:arial; } -->

<!-- td { font-family:arial; font-size:10pt; font-weight:normal } -->

<!-- th { font-family:arial; font-size:10pt; font-weight:bold } -->

<!-- p { font-family:arial; font-size:10pt; } -->

</STYLE>

<!-- Page Body -->

</HEAD>

<BODY bgcolor=FFFFFF>

<!-- Page Banner -->

<HR><CENTER>

<FONT size=4>Welcome to www.cleverpig.com</FONT>

<FONT size=2>

<HR>

<!-- Page Title -->

ASP Mail Send Page.

<P>

<IMG src='/images/ASPMailLogo.gif' align=center border=0>

<P>

<!-- ASP Mail Send Page -->

Mail To: <% = Request.QueryString("addressto") %><br>

<p>

<%

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

Mailer.RemoteHost = "smtp.alentus.com"

Mailer.FromName = "AutoMailer@Cleverpig"

Mailer.FromAddress = "AutoMailer@cleverpig.com"

Mailer.AddRecipient Request.QueryString("addressto"), Request.QueryString("addressto")

Mailer.Subject = "Auto Mail from Flash Application!"

Mailer.BodyText = Request.QueryString("txtmsg")

if not Mailer.SendMail then

Response.Write " Mailing Failed... Error is: <br>"

Response.Write Mailer.Response

else

Response.Write " sent successfully...<p>"

end if

%>

 

<P>

<A href='http://www.cleverpig.com/'>Click here</A> to return to the home page.

<!-- Page Footer -->

<HR>

<P>www.cleverpig.com is hosted by:

<BR>

<A href='http://www.alentus.com'><IMG src='/images/alentusLogo.gif' align=center border=0></A>

<A href='http://www.alentus.com'><IMG src='/images/alentusText.gif' align=center border=0></A>

</FONT>

</BODY>

</HTML>