My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
MailAdapter  
Configuration of the MailAdapter to send email via Flex Messaging
Phase-Implementation
Updated Feb 4, 2010 by andy.pow...@me.com

Introduction

The MailAdapter allows you to send emails via Flex Messaging. This page is the BlazeDS configuration of the MailAdapter.

messaging-config.xml configuration

<adapters>

...

<adapter-definition id="mail" class="flexserverlib.messaging.services.messaging.adapters.MailAdapter"/>

...

</adapters>

....

<destination id="mail-destination">
	<channels>
		<channel ref="my-polling-amf"/>
	</channels>

	<properties>
		<mail>
			<mail-server>smtp.comcast.net</mail-server>
			<message-type>SimpleMailMessage</message-type>
			<default-sender>test@flexserverlib.org</default-sender>
			<mail-server-port>25</mail-server-port>
			<username/>
			<password/>
			<default-subject/>
			<default-recipient/>
		</mail>
	</properties>

	<adapter ref="mail"/>
</destination>

MXML Sample

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onInitView(event)" layout="absolute" xmlns:messaging="flexserverlib.messaging.*">
	
	<mx:Script>
		<![CDATA[
			import flexserverlib.messaging.support.MailMessage;
			
			private function onInitView(e:Event):void{
			}
			
			private function onButtonClick(e:MouseEvent):void{
				var msg:MailMessage = new MailMessage();
				msg.sender = "sender@flexserverlib.org";
				msg.recipient = "recipient@flexserverlib.org";
				msg.subject = "TEST MESSAGE";
				msg.body = "this is a test.";
				mailSender.sendMail(msg);
			}
			
		]]>
	</mx:Script>
	
	<messaging:MailSender id="mailSender" destination="mailDestination"/>
	
	<mx:Button id="mailButton" label="Send Mail" click="onButtonClick(event)"/>
	
</mx:Application>

Sign in to add a comment
Powered by Google Project Hosting