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
Logan Connor
3,023 PointsEmerson Contact Form Stuck On Refresh When Submit Is Clicked
I have completed Mr. Paulk's course in Building Websites With PHP and am having difficulty with the form sending to a real website. I am hosting the page and have my email as the email for the data to be sent.
Is anyone else experiencing this problem? I thought it was my personal code that I wrote while following Mr. Paulk, so I grabbed his code from a fork and the same problem is occurring.
Any insight will be greatly appreciated.
2 Answers
Logan Connor
3,023 PointsAfter reviewing some things on SwiftMailer I changed
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
to
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t');
Here is a note about using -t: If you run sendmail in "-t" mode you will get no feedback as to whether or not sending has succeeded. Use "-bs" unless you have a reason not to.
http://swiftmailer.org/docs/sending.html
I doubt this is the best way... but it does work!
Logan Connor
3,023 PointsWill look into and check back. I have an account with WebhostingForStudents... the one Treehouse suggests.
Logan Connor
3,023 PointsSeems to be working. With the example code from the website you provided.
x x
511 Pointsx x
511 PointsOn two servers I tried this project I got following error after sending contact form:
Looks like this function is blocked on cheaper hosting. Maybe try running script from http://php.net/manual/en/function.proc-open.php to check if this function works ok on your server?