Flex/AIR: Sending email with embedded image.. how?

后端 未结 2 1728
广开言路
广开言路 2020-12-17 06:16

I\'m making a Flex AIR application that will produce a giftcard from a webcam picture. This giftcard needs to be sent in an e-mail to a recipient provided in the program. Sh

相关标签:
2条回答
  • 2020-12-17 06:40

    You could try using SMTP Mailer, an ActionScript library for SMTP. It supports attachments, so it should meet your needs.

    http://www.bytearray.org/?p=27

    0 讨论(0)
  • 2020-12-17 06:53
            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";
            var content:String = "This is content";
            mailer.sendAttachedMail ( "noreply@nobody", toEmail.text,subject, content, myCapStream, "style.jpg");
    

    I used SMTPMailer 0.9 that is hosted in google code. 0.6 has a problem with image attachment.For email, "Test Mail Server Tool" is used to simulate the mail server.

    0 讨论(0)
提交回复
热议问题