Sending Mail using PHP file


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
	<mx:HTTPService url="http://hemadri.info/sendmail.php" id="srv" result="res(event)" fault="flevent(event)"/>
	<mx:Form>
		<mx:FormHeading label="Sending Mail"/>
		<mx:FormItem label="E-Mail">
			<mx:TextInput id="tiemail"/>
		</mx:FormItem>
		<mx:FormItem label="Message">
			<mx:TextInput id="timsg"/>
		</mx:FormItem>
	</mx:Form>
	<mx:Button label="Send Mail" click="sendsrv()"/>
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			import mx.controls.Alert;
			private function res(e:ResultEvent)
			{
				Alert.show("Mail sent Successfully");
			}
			 private function flevent(f:FaultEvent)
			{
				Alert.show('fault '+f.fault.toString());
			}
			private function sendsrv()
			{
				var ob:Object=new Object;
				ob.email=tiemail.text;
				ob.message=timsg.text;
				srv.send(ob);
			}
		]]>
	</mx:Script>
</mx:Application>

~ by mjcprasad2000 on January 16, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: