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

Christopher Parke
Christopher Parke
21,978 Points

Mail not sending (XAMPP localhost setup)

Hello,

In this video we don't setup the SMTP and I'm wondering if that's why I'm getting the following error:

"Message could not be sent.Mailer Error: Could not instantiate mail function.". I continued on in the videos for a bit but it seems it's important to get the email to actually send to work on the next steps. What steps should I take to get the email to send on a local setup?

Thanks.

PS: Video Link -- https://teamtreehouse.com/library/build-a-basic-php-website/adding-a-basic-form/utilizing-object-properties-and-methods

2 Answers

jason chan
jason chan
31,009 Points

that's the local server. It should be in the mail directory

C:\xampp\mailoutput

If you buy a live monthly server it will email.

Christopher Parke
Christopher Parke
21,978 Points

Hey thanks Jason! that seemed to solve my first issue, however I still have a second before the email will send:

$mail->setFrom($email, $name); $mail->addAddress('E:\XAMPP\mailoutput', 'nothingworks@sigh.com'); //Add a recipient

So I've got the code laid out like this and I get a new error: "Message could not be sent.Mailer Error: You must provide at least one recipient email address."

Any clue what could be happening here?

Thanks

jason chan
jason chan
31,009 Points

I would just download the code from the example the instructor has. Kind of too much trouble troubleshooting typos. But if anything I would just go over the video again.