开发者

How to send e-mails from an Adobe AIR application?

I'm building an AIR app and it is supposed to, after saving a lot of data to a database, send an e-mail to some of the e-mails saved on the database. I've just tried this out but the output throws the following:

Error #2044: Unhandled IOErrorEvent:. text=Error #2031: Socket Error.
    at emailTester()[C:\Users\Lucas\Documents\Dan Naim\Sinagoga\Sinagoga\emailTester.as:20]
    at runtime::ContentPlayer/loadInitialContent()
    at runtime::ContentPlayer/playRawContent()
    at runtime::ContentPlayer/playContent()
    at runtime::AppRunner/run()
    at global/runtime::ADLEntry()

The code I'm using is:

   var mailer:SMTPMailer = new SMTPMailer("localhost",25);
   var myBitmap:BitmapData = new BitmapData(photo.width,photo.height);
   myBitmap.draw(photo);
   var myEncoder:JPEGEncoder = new JPEGEncoder(100);
   var myCapStream:ByteArray = myEncoder.encode (myBitmap);
   var subject:String = "subject goes here开发者_如何学Python";
   var content:String = "This is content";
   mailer.sendAttachedMail ( "noreply@nobody", toEmail.text,subject, content, myCapStream, "style.jpg");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜