The sample code for google gmail buzz using airxmail ( as3 smtp/pop library)

google_buzz

sender = new SMTPSender();
sender.setParameter(SMTPSender.HOST,"smtp.gmail.com");
sender.setParameter(SMTPSender.PORT,465);

//  use SMTP-AUTH
sender.setParameter(SMTPSender.AUTH,true);
sender.setParameter(SMTPSender.USERNAME,username);
sender.setParameter(SMTPSender.PASSWORD,password);

// use STARTTLS
sender.setParameter(SMTPSender.SOCKET_OBJECT,new com.hurlant.crypto.tls.TLSSocket());

// If you want to change the charset for mail header
AirxMailConfig.setDefaultHeaderCharset("UTF-8");
			
var mimeMsg:MimeMessage = new MimeMessage();
			
var from:INetAddress = new INetAddress();
from.personal = "coltware";
from.address = this.fromEmail;
			
mimeMsg.setFrom(from);
var toAddr:INetAddress = new INetAddress("buzz@gmail.com","buzz");
mimeMsg.addRcpt(RecipientType.TO,toAddr);
// set mail subject
mimeMsg.setSubject("My first buzz from airxmail");
mimeMsg.setTextBody("");

sender.send(mimeMsg);
sender.close();

Related Posts

5 Responses to “Airxmail – sample for google gmail buzz”

  • Maryetta Emano より:

    I wish I could find the time to write consistantly at my blog, on a day to day basis, like you do. Nicely done! I look forward to your additional article.

  • Wilford Viejo より:

    I’m diggin’ this site. I visit it frequently. I like the changes.

  • hungconcon より:

    I recently created an AS3 Mail, if I compile a SWF file in the application environment, it can send , but if I publish the Web and send mail it not go. is it necessary crossdomain?
    I try smtp.gmail.com, tls and public on localhost iis.
    Everybody help me?
    Thanks in advance

  • coltware より:

    Yes. I think you need to care crossdomain.
    So it is difficult to use socket application(like airxmail) on web.
    Anyway, I don’t know crossdomain policy in detail.

  • Nice work to be done by you. i wish i could find the time to write consistantly at my blog… thanks

Leave a Reply

Spam protection by WP Captcha-Free

RSS
Add to Google
2010年3月
    5月 »
 123456
78910111213
14151617181920
21222324252627
28293031