Welcom

AirxMail is SMTP/POP3 ActionScript 3 ( Flex AIR ) library.

AirxMail API is composed of a set of abstract classes( like a Java MAIL API )

Download

http://code.google.com/p/airxmail/downloads/list

System Requirements

Adobe AIR 1.5 or more

Source codes

see google code

How to use API

SMTP API

quick start
import com.coltware.airxmail.INetAddress;
import com.coltware.airxmail.MailSender.SMTPSender;
import com.coltware.airxmail.MimeMessage;
import com.coltware.airxmail.RecipientType;
// (Option) If you use TLSSocket
import com.hurlant.crypto.tls.TLSSocket;


private function send_plain_email():void{
	//  How to send plain text email
	var sender:SMTPSender = new SMTPSender();
	sender.setParameter(SMTPSender.HOST,"smtp.gmail.com");
	sender.setParameter(SMTPSender.PORT,465);  // default port is 25
	// If you use SMTP-AUTH
	sender.setParameter(SMTPSender.AUTH,true);
	sender.setParameter(SMTPSender.USERNAME,"username");
	sender.setParameter(SMTPSender.PASSWORD,"password");
	
	// If you use TLS/SSL
        // you can get as3crypto at http://code.google.com/p/as3crypto/
	var tlssocket:TLSSocket = new TLSSocket();
	sender.setParameter(SMTPSender.SOCKET_OBJECT,tlsobject);
	
	// Create email message
	var message:MimeMessage = new MimeMessage();
	
	//	Set from email address and reciepients
	var from:INetAddress = new INetAddress("from-email-address@xxxx.yyyy","from label");
	message.setFrom(from);
	
	var toRecpt:INetAddress = new INetAddress("to-email-address@xxxx.yyyy","to label");
	message.addRcpt(RecipientType.TO,toRecpt);
	
	var ccRecpt:INetAddress = new INetAddress("cc-email-address@xxxx.yyyy","cc label");
	message.addRcpt(RecipientType.CC,ccRecpt);
	
	//  
	message.setSubject("hello world");
	message.setTextBody("welcom !! \r\n this is first email. ");
	
	sender.send(message);
	sender.close(); 
}

more details….

POP3 API

quick start

import com.coltware.airxmail.MimeMessage;
import com.coltware.airxmail.pop3.POP3Client;
import com.coltware.airxmail.pop3.POP3ListEvent;
import com.coltware.airxmail.pop3.POP3MessageEvent;
// (Option) If you use TLSSocket
import com.hurlant.crypto.tls.TLSSocket;

private function pop3_sample1():void{

var client:POP3Client = new POP3Client();
client.host = “pop.gmail.com”;
client.port = 995; // default port is 110

client.setAuth(“username”,”password”);

// If you use TLS/SSL
// you can get as3crypto at http://code.google.com/p/as3crypto/
var tlssocket:TLSSocket = new TLSSocket();
client.socketObject = tlssocket;

client.addEventListener(POP3ListEvent.POP3_RESULT_UIDL,result_uidl);
client.addEventListener(POP3MessageEvent.POP3_MESSAGE,result_message);
client.connect();
client.uidl();
}

private function result_uidl(e:POP3ListEvent):void{
for(var i:int=0; i