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

后端 未结 2 1730
广开言路
广开言路 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: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.

提交回复
热议问题