Frickin’ Email!What the [enter-your-favorite-expletive-here]! |
Ok confession one, I fudged the sendEmail method in Project 2: User RegistrationCreate registration process to allow users to create and manage an account. Use login to restrict execution of administrator functions that are accessible via the website.. Based on everything I found online the code should have worked and I was waiting for the transfer of the trialbydata.com domain to Route 53 to try it using Amazon SES. Confession two, while I’ve written applications that have sent emails before I’m a noob with regards to how this all works on the backend; Postfix meant nothing to me, SMTP and TLS next to nothing. But I can google and copy-paste code with the best of them and up until now, that worked.
Battle 1: Setting up MockSMTPAn app for viewing test e-mails generated by the website on Mac OS.
After much stumbling around in the dark the answer was found on Free Lance Level Up. God bless you, Jason Forrest! I’ll attempted to summarize based on my limited understanding so expect some level of gibberish; for actual details follow the link above.
So Postfix is not automatically running on MacBook, that is probably obvious to a lot of you but I only learned about its existence a couple of days ago. As Postfix is the mail transfer agent, unsurprisingly, it needs to be running if you want to send emails from your application. (By the way, it would have been helpful if one of the many tests I ran returned an error that said something to this effect.) Additionally, you need to tell Postfix how to direct your email and provide it with the necessary credentials. Sounds simple now but it was a long road with many detours to get here.
Battle 2: Setting up Real SMTP
The big issue here is that I originally bought the domain trailbydata.com from another registrar and then transferred it to Amazon Route53Amazon service for purchasing domains and managing associated DNS entries.. The steps were followed and a transfer-success message was received but all attempts to do a nslookup on the domain failed. Using the InterNIC site showed that the NS (name server) record was still pointing at the old registrar. Route53Amazon service for purchasing domains and managing associated DNS entries. had the new values assigned by Amazon but InterNIC still had the old values.
Unsuccessfully attempts to trigger an update using Route53Amazon service for purchasing domains and managing associated DNS entries.’s Manage DNS functionality by shortening the TTL value and changing the order of the names servers provided by Amazon were made. As it turns out there is a “Add or edit name servers” option on the main page of the Registered Domain details page which allowed the value to be updated to the new Amazon values. Not sure why this didn’t happen as part of the transfer but once this was resolved it was possible to move forward with setting up SES for the site.