English 中文(简体)
• 如何将邮件寄给第三号行动版本中的PHP?
原标题:How to send mail with PHP in ActionScript 3?

I ve found many samples on the internet regarding my question, but I simply want to send just a message/text and understand the connection between PHP and AS3.

最佳回答

简言之,邮件的指挥只是这样。

<?php
mail(
    "email@website.com",
    "This is the title, or subject",
    "This is the body of the message",
    "From: Emailer <email@website.com>"
);
?>

在某些情况下,你可能不得不没收你的PHP.ini档案。

问题回答

你的网址将用某种方式寄出邮件,并可能期望通过Http请求寄出一些参数,使用POST或GET方法。 典型的网址邮稿就是这样......

<?php
    $to = $_POST["to"];
    $subject = $_POST["subject"];
    $message = $_POST["message"];
    $from = "youre@email.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Successfully sent";
?>

为了把这一文字从行动上说出来,你需要制造一个变数物体。

var variables:URLVariables = new URLVariables();
variables.to = "whoever";
variables.message = "text";
variables.subject = "subject";

变数名称(.to, .message)必须完全与变数相匹配。

现在,你可以提出你的要求。 反对,具体说明你的文字的位置。 举例来说,确保采用这种方法。 您将上述变量添加到请求的数据标本中。

var request:URLRequest = new URLRequest( "yourScript.php" );
request.method = URLRequestMethod.POST;
request.data = variables;

之后又创建了URLLoader,并增加了一个活动听众。 不要将上述要求转达给施工者,而是通过装载方法。

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete );
loader.load( request );

手里可以这样看。 这部法典应当追溯到“成功发送”。

private function onComplete( e:Event ) : void
{
    trace( URLLoader( e.target ).data.toString() );
}

当然,你也可以增加处理听众的错误,例如,有些情况是错误的,但如果你控制了网址的文字和行动文字,你就应该有问题。





相关问题
Angle brackets in php

I want to store angle brackets in a string in PHP because i want to eventually use mail() to send an HTML email out. The following is the code that doesn t seem to work. while(...) { $msg .= "<...

authlogic auto_register feature using my options

I have auto registration working with authlogic using gaizka s version of authlogic_openid which I found on Github since pelle s original addition of the feature seemed to cause issues. http://...

Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

How to track an email in Java?

How I can track an email? I m using java on the server side for sending emails. I want to track whether it is delivered , opened, etc... How I can do that ?

Web Link in a mail is not rendering as link in yahoo

string from = "abc@gmail.com"; string to = "xyz@gmail.com,xyz@yahoo.co.in"; string password="abcxyz"; MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(to); mail.From = new ...

SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

How to create an email mailing list

Im creating a coming soon page for a website im developing, and im adding an option for the user to enter their email address so we can email them when the site is up. How do I do this?

CCNet email does not include MSBuild results

We re using CCNet 1.4.4.83 but when an MSBuild task fails, we don t get the MSBuild results (i.e. missing file or whatever reason the compile failed) in the email notification. I do see the build ...

热门标签