Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Noah Schade
Noah Schade
17,694 Points

How do I disable phpmailer message?

I used phpmailer. I used the same form as in this course https://teamtreehouse.com/library/smtp-with-google. When I submit a form at my website: http://rarebookstore.store/Simple%20Custom%20Form/index.php I get this message and I would like to disable it. How do I do this?

2018-07-06 10:25:22 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP s184-v6sm4776727oig.51 - gsmtp 2018-07-06 10:25:22 CLIENT -> SERVER: EHLO rarebookstore.store 2018-07-06 10:25:22 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [50.87.144.177]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2018-07-06 10:25:22 CLIENT -> SERVER: STARTTLS 2018-07-06 10:25:22 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS 2018-07-06 10:25:22 CLIENT -> SERVER: EHLO rarebookstore.store 2018-07-06 10:25:22 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [50.87.144.177]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2018-07-06 10:25:22 CLIENT -> SERVER: AUTH LOGIN 2018-07-06 10:25:22 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2018-07-06 10:25:22 CLIENT -> SERVER: <credentials hidden> 2018-07-06 10:25:22 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2018-07-06 10:25:22 CLIENT -> SERVER: <credentials hidden> 2018-07-06 10:25:22 SERVER -> CLIENT: 235 2.7.0 Accepted 2018-07-06 10:25:22 CLIENT -> SERVER: MAIL FROM:noahschade101@gmail.com 2018-07-06 10:25:22 SERVER -> CLIENT: 250 2.1.0 OK s184-v6sm4776727oig.51 - gsmtp 2018-07-06 10:25:22 CLIENT -> SERVER: RCPT TO:noahschade101@gmail.com 2018-07-06 10:25:22 SERVER -> CLIENT: 250 2.1.5 OK s184-v6sm4776727oig.51 - gsmtp 2018-07-06 10:25:22 CLIENT -> SERVER: DATA 2018-07-06 10:25:22 SERVER -> CLIENT: 354 Go ahead s184-v6sm4776727oig.51 - gsmtp 2018-07-06 10:25:22 CLIENT -> SERVER: Date: Fri, 6 Jul 2018 05:25:21 -0500 2018-07-06 10:25:22 CLIENT -> SERVER: To: Noah Schade noahschade101@gmail.com 2018-07-06 10:25:22 CLIENT -> SERVER: From: dfsfsdf noahschade101@gmail.com 2018-07-06 10:25:22 CLIENT -> SERVER: Subject: Message from dfsfsdf 2018-07-06 10:25:22 CLIENT -> SERVER: Message-ID: qDx5dfsqGpTHX7eUnBW4yX2f8f25LKCmL0XJmxYZwA@rarebookstore.store 2018-07-06 10:25:22 CLIENT -> SERVER: X-Mailer: PHPMailer 6.0.5 (https://github.com/PHPMailer/PHPMailer) 2018-07-06 10:25:22 CLIENT -> SERVER: MIME-Version: 1.0 2018-07-06 10:25:22 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1 2018-07-06 10:25:22 CLIENT -> SERVER: 2018-07-06 10:25:22 CLIENT -> SERVER: Name dfsfsdf 2018-07-06 10:25:22 CLIENT -> SERVER: Email sdfdsf@sdfsdf.com 2018-07-06 10:25:22 CLIENT -> SERVER: Details asdassd 2018-07-06 10:25:22 CLIENT -> SERVER: 2018-07-06 10:25:22 CLIENT -> SERVER: . 2018-07-06 10:25:23 SERVER -> CLIENT: 250 2.0.0 OK 1530872723 s184-v6sm4776727oig.51 - gsmtp 2018-07-06 10:25:23 CLIENT -> SERVER: QUIT 2018-07-06 10:25:23 SERVER -> CLIENT: 221 2.0.0 closing connection s184-v6sm4776727oig.51 - gsmtp

Warning: Cannot modify header information - headers already sent by (output started at /home4/noah9/rarebookstore.store/src/Simple Custom Form/vendor/phpmailer/src/SMTP.php:253) in /home4/noah9/rarebookstore.store/src/Simple Custom Form/index.php on line 73

1 Answer

Noah Schade
Noah Schade
17,694 Points

I found the answer to my own question. In the index.php file this line had to be commented out: $mail->SMTPDebug = 2;