Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.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 如何使按钮使用AS3自动发送电子邮件_Actionscript 3_Email_Mailto - Fatal编程技术网

Actionscript 3 如何使按钮使用AS3自动发送电子邮件

Actionscript 3 如何使按钮使用AS3自动发送电子邮件,actionscript-3,email,mailto,Actionscript 3,Email,Mailto,我在ActionScript3.0中工作,正在制作一个网站 在我的网站上,我想做一个按钮,通过点击按钮发送电子邮件,我不希望它打开他们的邮件客户端,而只是发送它 我目前正在使用“mailto”功能,但想知道如何使其自动发送,或者我可以使用什么来实现这一点 以下是我的代码片段: function submitPoll(e:MouseEvent):void { //sending the email stuff var request:URLRequest = new URLRequest

我在ActionScript3.0中工作,正在制作一个网站

在我的网站上,我想做一个按钮,通过点击按钮发送电子邮件,我不希望它打开他们的邮件客户端,而只是发送它

我目前正在使用“mailto”功能,但想知道如何使其自动发送,或者我可以使用什么来实现这一点

以下是我的代码片段:

function submitPoll(e:MouseEvent):void {

  //sending the email stuff
  var request:URLRequest = new URLRequest("mailto:name@hotmail.com"+"?subject=Subject"+"&body= Hello world ");
  navigateToURL(request, "_blank"); 
  request.method = URLRequestMethod.POST;

  //other

  Submit_btn.x = -100;

  pollUsed = true;
  thanks_txt.x = 849;
  thanks_txt.y = 656;

}

我认为这是对另一个PHP文件执行URL请求的情况。将textfield的值发送到PHP文件并以这种方式处理电子邮件


我手头没有任何代码,但这就是我在做同样的事情时所做的。希望这有助于。。。不要忘记验证:)

在发送电子邮件时,使用Flash的情况与使用HTML的情况大致相同。您有两种选择:

  • 使用
    mailto
    在用户计算机上弹出电子邮件客户端
  • POST
    GET
    请求发送到可以代表您发送电子邮件的服务器
  • 您要做的是第2项,这意味着您需要访问能够发送邮件的服务器,该服务器还可以接收
    GET/POST
    请求。如果您有脚本访问您的Web服务器,您无疑可以找到一个免费的在线脚本,允许您发送电子邮件。例如:

    如何将信息发送到脚本将取决于脚本要求您发送的变量。从ActionScript中,您可能需要使用:


    如果可能的话,一个人所能造成的伤害将是无法估量的。是时候学习一些服务器端的东西了。
    const SCRIPT_URL:String = "http:// .... your server ... / ... script file ...";
    var request:URLRequest = new URLRequest(SCRIPT_URL);
    var variables:URLVariables = new URLVariables();
    
    // these depend on what names the script expects
    variables.email = "name@hotmail.com";
    variables.subject = "Subject";
    variables.body = "Hello World";
    
    request.data = variables;
    
    // depends if the script uses POST or GET
    // adjust accordingly
    request.method = URLRequestMethod.POST;
    
    var urlLoader:URLLoader = new URLLoader();
    loader.load(request);