質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

Q&A

解決済

1回答

591閲覧

PHPお問い合わせフォームを作っているのですが送信出来ません。

fuyukixxx

総合スコア26

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

0グッド

0クリップ

投稿2020/05/19 04:12

編集2020/05/22 10:10

PHP初心者のものなんですが、送信ボタンを押しても、gmailの方に届きません。迷惑メールの方も確認しましたがなかったです。
dockerを使ってxserverにあげています。どこが原因でメールが送れないのでしょうか?
回答お待ちしております。

HTML

1コード<form action="index.php" method="POST"> 2 <div class="form-content pt-5"> 3 <div class="form-left "> 4 <div class="form-group"> 5 <input type="text" class="form-control" name="name 6 " placeholder="名前"> 7 </div> 8 <div class="form-group mt-5"> 9 <input type="text" class="form-control" name="email 10 " placeholder="メールアドレス"> 11 </div> 12 </div> 13 <div class="form-right"> 14 <div class="form-group"> 15 <textarea class="form-control" name="message 16 " placeholder="お問い合わせ" rows="10"></textarea> 17 </div> 18 </div> 19 </div> 20 <p><input type="submit" value="上記の内容で送信する" class="wpcf7-form-control wpcf7-submit text-center" id="button"></p> 21

PHP

1コード<?php 2 3if (isset($_POST['submit'])) { 4 $name = $_POST['name']; 5 $emailFrom = $_POST['email']; 6 $message = $_POST['message']; 7 8 $mailTo = "valance46matafall@gmail.com"; 9 $headers = "From: ".$mailFrom; 10 $txt ="You have received an e-mail from " .$name.".\n\n".$message; 11 12 mail($mailTo, $txt , $headers); 13 header("location: index.php?mailsend"); 14 15}

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2020/05/19 04:53 編集

gmailのメアドをコードの中で晒してますが、大丈夫? 質問削除申請する? MAMPを入れているパソコンはMacでしょうか? メール送信に関わる設定ごとはどこまで確認済みでしょうか。
fuyukixxx

2020/05/19 05:07

大丈夫です。パソコンはmacです。
guest

回答1

0

ベストアンサー

Macでの開発者のアドバイスを待つまでの間でも、
「mamp メール送信」などの検索ワードで、
期間を直近1年間に絞るなどすると、
いくつかの事例を見つけることができますね。
メール送信サーバーを適切に設定することで解決しそうですが。

投稿2020/05/19 08:45

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

fuyukixxx

2020/05/20 03:48

https://codeforfun.jp/how-to-send-email-with-postfix-and-gmail/?unapproved=356&moderation-hash=29f03ce4509f1db53364b641727bda64#comment-356 回答ありがとうございます。このサイト通りにやったのですが、/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: use_sacl_cache=yes /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: imap_submit_cred_file=/etc/postfix/submit.cred postfix/postfix-script: warning: group or other writable: /Library/Server/Mail/Data/mta/. postfix/postfix-script: starting the Postfix mail system postfix/postfix-script: fatal: mail system startup failed と出て起動出来ないです。
退会済みユーザー

退会済みユーザー

2020/05/20 03:57

そうなると、PHPやHTMLの問題というよりもPostfixの設定周りになるので、 質問につけるタグにPostfixをつけることと、 質問文も見直ししてPostfixの設定がうまく行かなくてメール送信できずにいるという内容に変えるべきかと。 (私はMacもPostfixも教えられる情報がないので、注目を集められる内容に見直ししないと進展しないかと。)
fuyukixxx

2020/05/20 04:37

わかりました。対応ありがとうございます。
退会済みユーザー

退会済みユーザー

2020/05/22 11:23

質問につけるタグにPostfixをつけることと、 質問文も見直ししてPostfixの設定がうまく行かなくてメール送信できずにいるという内容に変えるべきかと。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問