phpとflashの連携でメールが送信されない - PHPプロ!Q&A掲示板
2854
- 0P
- 0P
phpとflashの連携でメールが送信されない
質問日時 / 2010年9月4日 22:11 (最終編集:9月4日 22:38) 回答数 / 12件
Questioner: sinsinsinsin
Tweet
キーワード / メール  
email.phpの内容
<?php
//Type the receiever's e-mail address
$emailAddress = "info@email.com";←ここを自分のメールアドレスしました。
//Type your Site Name
$siteName = "Company Name";
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_subject = $_POST['subject'];
$contact_message = $_POST['message'];
if( $contact_name == true ) {
$sender = $contact_email;
$receiver = $emailAddress;
$client_ip = $_SERVER['REMOTE_ADDR'];
$email_body = "The Name Of The Sender: $contact_name \nEmail: $sender \n\nSubject: $contact_subject
\n\nMessage: \n\n$contact_message \n\nIP ADDRESS: $client_ip \n\n$siteName";
$emailAutoReply = "Hi $contact_name, \n\nWe have just received your E-Mail. We will get
in touch in a few days. Thank you! \n\n$siteName ";
$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
$autoReply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();
mail( $sender, "Auto Reply: $contact_subject", $emailAutoReply, $autoReply );
if( mail( $receiver, "New E-Mail - $contact_subject", $email_body, $extra ) ) {
echo "success=yes";
} else {
echo "success=no";
}
}
?>
ActionScriptの内容
function clearField()
{
txtField1.text = label1;
txtField2.text = label2;
txtField3.text = label3;
txtField4.text = label4;
txtField5.text = label5;
txtField6.text = label6;
} // End of the function
label1 = "Name";
label2 = "Company";
label3 = "E-mail";
label4 = "Phone";
label5 = "Subject";
label6 = "Message";
countField = 6;
clearField();
var arrayLabel = new Array();
for (i = 1; i < countField + 1; i++)
{
txtField = this["txtField" + i];
txtField.index = i;
arrayLabel[i] = this["label" + i];
txtField.tabIndex = i;
txtField.onSetFocus = function ()
{
if (this.text == arrayLabel[this.index])
{
this.text = "";
} // end if
};
txtField.onKillFocus = function ()
{
if (this.text == "")
{
this.text = arrayLabel[this.index];
} // end if
};
} // end of for
btnClear.onRollOver = function ()
{
this.gotoAndPlay("over");
};
btnClear.onRollOut = btnClear.onReleaseOutside = function ()
{
this.gotoAndPlay("out");
};
btnClear.onRelease = function ()
{
clearField();
};
btnSubmit.onRollOver = function ()
{
this.gotoAndPlay("over");
};
btnSubmit.onRollOut = btnSubmit.onReleaseOutside = function ()
{
this.gotoAndPlay("out");
};
btnSubmit.onRelease = function ()
{
if (_root.content.page5.contactform.txtField1.text == label1 || _root.content.page5.contactform.txtField2.text == label2 || _root.content.page5.contactform.txtField3.text == label3 || _root.content.page5.contactform.txtField4.text == label4 || _root.content.page5.contactform.txtField5.text == label5 || _root.content.page5.contactform.txtField6.text == label6)
{
gotoAndStop(3);
}
else
{
_root.pages.page5.contactform.loadVariables("email.php", "POST");
gotoAndStop(2);
} // end else if
};
stop ();
使えるようにするにはどうしたらよいでしょうか?
よろしくお願いします。
この質問への意見の募集は締め切られ、ポイントは既に配分されました。
意見を投稿することはできますが、ポイントを受け取ることはできません。





ページのトップへ


今回のような実践的な経験がエンジニアのキャリアに繋がると思います。是非サービスを成功させて下さい!