Posts Tagged ‘mail’
I started to develop Mail WEB API server.
I inspired by Yahoo Mail Service.
It doesn’t depends on Any specific mail service.
So you can choose Gmail , Yahoo mail , Any other SMTP/IMAP4/POP3 server.
I’d like to show the demo implementation until April 2012.
The following picture is technical stack so far.
The feature plan
* Text EventStream connection for server push event.
etc ) to know new incoming mail
* Auto-reconnect for POP3/IMAP4
( Username/Password saved instance memory )
* use Database System.
* ActionScript Client API
* Network layer authority
Example:
If you see messages from LAN , No limitation exists.
But you see messages from Internet, You can’t download any attachments files.
Or you can’t see very important message.
etc, etc..
* Full text-index search
Requirement:
Java :
Not work on Android so far. But I don’t want to use the library that does NOT support to work on Android.
So I don’t use Tomcat or Any J2EE application server.
DB:
MySQL, PostgreSQL, Apache Derby, H2, SQLite
This is a sample code to send email attachments for airxmail(actionscript 3 smtp/pop3 library).
Requirements:
Flex SDK 3.4 or more
AIR 1.5 or more
airxmail library ( download )
related links:
Basic usage of airxmail
How to send html mail.
sample code
use MimeBinaryPart ( application/octet-stream )
basic usage
var contentType:ContentType = ContentType.MULTIPART_MIXED;
var mimeMsg:MimeMessage = new MimeMessage(contentType);
:
:
var filePart:MimeBinaryPart = new MimeBinaryPart();
filePart.setAttachementFile(File.desktopDirectory.resolvePath("image.jpg"),"attachemnt-image.jpg");
mimeMsg.addChildPart(filePart);
sender.send(mimeMsg);
sender.close();
how to change content-type
var filePart:MimeBinaryPart = new MimeBinaryPart()
filePart.contentType.setMainType("image");
filePart.contentType.setSubType("jpeg");
Note: MimeImagePart is image/xxxx part.
filePart:MimeImagePart = new MimeImagePart(); filePart.setAttachementFile(file,"attachemnt-image.jpg"); // --> image/jpeg //filePart.setAttachementFile(file,"attachemnt-image.gif"); // --> image/gif

