Archive for 8月, 2010

var contentType:ContentType = ContentType.MULTIPART_MIXED;
var mimeMsg:MimeMessage = new MimeMessage(contentType);

var from:INetAddress = new INetAddress();
from.personal = 
from.address = "from.email.address@coltware.com";


mimeMsg.setFrom(from);
mimeMsg.setReplyTo(from);
var toAddr:INetAddress = new INetAddress("to.email.address@coltware.com","hello airxmail");
mimeMsg.addRcpt(RecipientType.TO,toAddr);
// set mail subject
mimeMsg.setSubject("Hello World"); 
mimeMsg.setTextBody("this is multipart message");  

//
//  Plain Text Part
//
var textPart:MimeTextPart = new MimeTextPart();
textPart.contentType.setParameter("charset","UTF-8");
textPart.transferEncoding = "8bit";
textPart.setText("This is text body part \n This is 2nd line.");
mimeMsg.addChildPart(textPart);

//
//  Attachment part 
//
var filePart:MimeImagePart = new MimeImagePart();
filePart.contentType.setMainType("image");
filePart.contentType.setSubType("jpeg");
filePart.setAttachementFile(File.desktopDirectory.resolvePath("image.jpg"),"fireworks.jpg");
mimeMsg.addChildPart(filePart);
RSS
Add to Google
2010年8月
« 7月   11月 »
1234567
891011121314
15161718192021
22232425262728
293031