Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何从AdobeAIR应用程序发送电子邮件?_Actionscript 3_Email_Sockets_Air_Smtp - Fatal编程技术网

Actionscript 3 如何从AdobeAIR应用程序发送电子邮件?

Actionscript 3 如何从AdobeAIR应用程序发送电子邮件?,actionscript-3,email,sockets,air,smtp,Actionscript 3,Email,Sockets,Air,Smtp,我正在构建一个AIR应用程序,它应该在将大量数据保存到数据库后,向保存在数据库中的一些电子邮件发送一封电子邮件。我刚刚尝试过,但输出抛出以下内容: Error #2044: Unhandled IOErrorEvent:. text=Error #2031: Socket Error. at emailTester()[C:\Users\Lucas\Documents\Dan Naim\Sinagoga\Sinagoga\emailTester.as:20] at runtime

我正在构建一个AIR应用程序,它应该在将大量数据保存到数据库后,向保存在数据库中的一些电子邮件发送一封电子邮件。我刚刚尝试过,但输出抛出以下内容:

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()
我使用的代码是:

   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");

您是否在本地主机上运行SMTP服务器?您需要,或者您需要连接到运行上述服务器的计算机。我不知道,我以前从未尝试过类似的方法。它将作为一个AIR应用程序在客户机上运行,我应该如何继续?您需要使用一个已知应用程序的地址实例化
SMTPMailer
。找到一个允许从客户机连接的。这是在单个企业中运行的吗?然后向IT部门询问用于内部应用的SMTP服务器的地址。