First thing first, i'm totally new to this kind of localhost server setup and i've been spending the last couple of days trying to figure this out, but with no luck.
I'm developing a php website with an email form.
I'm on a MAC using codekit and MAMP FREE and everything works fine. Now my question is, is it possible to test the email that should be sent from the form locally?
I've tried a lot of examples, like uncommenting the [mail function]
bit in php.ini
file, installing 3rd parties app like fakeSMTP and MockSMTP but absolutely nothing worked. The mailto()
code should work, as when i debug it no error are thrown
Is it possible to do that or not? anyone who knows how to properly set this up or that can point me to a dumb-proof guide?
Ok, if someone is interested in this, i finally found a way to make it work.
I'm gonna explain it here in a detailed step-to-step tutorial.
gmail.com
as domain for outgoing emails and then click the button"Use this data"
After this is done, you want to open the terminal and type in
sudo nano /System/Library/LaunchDaemons/org.postfix.master.plist
(this will allow you to edit the org.postfix.master.plist file otherwise not editable.The only edit that you want to do is adding at the top, right after
<dict>
, this line<key>Disabled</key>
Now close the terminal and restart your mac.
status:sent
. This status sent means that the email has been sent and that the local test worked as expectedto
section in yourmail()
functionI'm using it, and it is actually working nicely.
After this, I made a couple of adjustment in my gmail inbox, adding an alias and a filter. I'm gonna explain this as well as it may be useful for a beginner
[myemailaddress]+test@gmail.com
)[myemailaddress]+test@gmail.com
That's it! hope this is clear enough and that it will help some of you.