teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

表記変更

2018/05/16 07:35

投稿

Nitta
Nitta

スコア96

title CHANGED
File without changes
body CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  $mail = new PHPMailer\PHPMailer\PHPMailer();
29
29
  //$mail->IsSMTP();
30
- $mail->IsSMTP(false);
30
+ $mail->IsSMTP();
31
31
  $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
32
32
  $mail->SMTPAuth = true;
33
33
  $mail->CharSet = 'utf-8';

2

表記変更

2018/05/16 07:35

投稿

Nitta
Nitta

スコア96

title CHANGED
File without changes
body CHANGED
@@ -45,7 +45,7 @@
45
45
 
46
46
  if( !$mail -> Send() ){
47
47
  $message = "Message was not sent<br/ >";
48
- $message .= "Mailer Error: " . $mailer->ErrorInfo;
48
+ $message .= "Mailer Error";
49
49
  } else {
50
50
  $message = "Message has been sent";
51
51
  }
@@ -55,6 +55,4 @@
55
55
 
56
56
  Error:
57
57
  2018-05-16 05:58:39 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
58
- PHP Notice: Undefined variable: mailer in C:\php\nitta.php on line 35
59
- PHP Notice: Trying to get property 'ErrorInfo' of non-object in C:\php\nitta.php on line 35
60
- Message was not sent<br/ >Mailer Error:
58
+ Message was not sent<br/ >Mailer Error

1

内容変更

2018/05/16 07:27

投稿

Nitta
Nitta

スコア96

title CHANGED
File without changes
body CHANGED
@@ -3,7 +3,7 @@
3
3
  SMPTの部分で接続失敗とのエラーが検出されます。
4
4
  requireのファイル群に関しては、それぞれ間違いなく存在しています。
5
5
  また、php.iniにも
6
- SMPT=smtp.gmail.com
6
+ SMTP=smtp.gmail.com
7
7
  smpt_port=587
8
8
  send_mail="-------@gmail.com"
9
9
  でそれぞれ登録しています。