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 trialTim Rohweder
25,527 PointsHelp with getting phpMailer to work on client's server.
I'm using phpMailer to power a contact form and it works great on my own server (through Bluehost) for testing purposes.
When I upload the same files to my client's server (through Century Link/Savvis), the 'thanks for contacting us' page appears, but the email never arrives to the inbox.
I know very little about servers aside from how to use FTP, but I'm assuming it must be an issue with my client's server? Something with permissions or some installation? How do I even begin to investigate that?
If it helps, the client's site is http://bearsbikebarn.com -- it's an old site from another designer and I was just brought in to make the contact form work again.
Thanks for any help!
3 Answers
Fahad Alrahbi
1,080 PointsCheck the ports , check the firewall if there is an condition block this , if not try to use smtp
Ron McCranie
7,837 PointsYou can try using the phpMailer class to send via SMTP using an existing email account on a server like Gmail. You could also setup a free Mandrill account and use some settings like this:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.mandrillapp.com';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = 'foo_username';
$mail->Password = 'foo_password';
// if you have a subaccount
$mail->AddCustomHeader('X-MC-Subaccount:' . 'your_foo_subaccount');
Tim Rohweder
25,527 PointsThanks for the suggestions. I got in touch with the hosting company and it turns out there had to be a special e-mail address in place in the "from:" field of the script for their servers to process it.
Ron McCranie
7,837 PointsThat sounds about right. There's a way to whitelist/blacklist senders and recipients in the Postfix configuration. I've spent many hours this past week getting mine tuned just right.