<html> <head> </head> <body> <?php mb_language("ja"); mb_internal_encoding("UTF-8"); if (isset($_POST["sousin"])){ $subject="メールフォーム投稿"; $title = $_POST["title"]; $name = $_POST["name"]; $email = $_POST["email"]; $comment = $_POST["comment"]; $content="題名:$sub\nお名前:$name\nEmail:$email\n--------内容--------\n$comment"; $mailfrom="From:" .mb_encode_mimeheader($name) ."<$email>"; mb_send_mail($mailto,$subject,$content,$mailfrom); echo "送信完了しました。"; } ?> <form method="post" action="form.php"> お名前: <input type="text" name="name" size=40><br> メールアドレス: <input type="text" name="email" size=60><br> 件名: <input type="text" name="title" size=60><br> 本文: <textarea name="comment" cols=50 rows=5></textarea><br> <input type="submit" name="sousin" value="メール送信"> </form> </body> </html> |