Flex / AIR: sending emails with embedded image .. how?

I am creating a Flex AIR application that will create a gift card from a webcam image. This gift card must be emailed to the recipient indicated in the program. Should I upload the image to the server and use php to send mail?

+3
source share
2 answers

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

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

+5
source
        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");

SMTPMailer 0.9, google. 0.6 . "" Test Mail Server Tool" .

+3

Source: https://habr.com/ru/post/1708920/


All Articles