Setting up a localhost mail server on Mac OSX - php

I would love to be able to test php webapps that require emailing registration info etc. on my mac. I downloaded a version of CommuniGate Pro. I need to mail either to an account inside or outside (whichever is best) of the localhost. Again this would be used for testing purposes to verify and debug my code prior to uploading to a hosting service. Any ideas, help and/or examples would be very much appreciated. If it would be easier I could go over to Windows XP. That would just mean setting up wamp and transfering my files over from the mac side via dropbox.

The following tutorial will help you to view emails sent by your local web apps in Mail.app
http://traumwind.de/tindertraum/archives/local_mail_osx.html

Related

How to test PHP send mail on local server with MAMP Pro

I have a small web form that on submission triggers a mail script that sends an email to the address given to verify their email address.
I want to test this on my local server using MAMP Pro. I am totally confused from the info I have sourced that holds different advice and requirements.
I use Dreamweaver (DW) with WebAssist (WA) extensions to build my PHP scripts and when I contacted WA support to ask how to enter the correct settings with their DW plugin to work with MAMP pro they told me..
To have your localhost send email you need to install a local SMTP server configured for email relay.
If you want to use a remote smtp server you would likely have to use the PEAR mail option for authentication.
This has thrown me as I can't see anywhere in any MAMP Pro documentation about having to install SMTP servers and I know nothing about PEARL.
The following Blog makes it sound simple..
http://blog-en.mamp.info/2009/09/how-to-sending-emails-with-mamp-pro.html
But it obviously isn't as I have tried these Postfix settings with know joy.
I have also seen this post..
Test emails locally with mamp
..that gives a method using gmail but I just can't make sense of it as It appears that the MAMP interface may have changed since this was written.
Plus I am not familiar with using Terminal.
If anyone can shed some light on this to point me in the right direction I would be most greatfull
You can use Mailhog to achieve this. I wrote a tutorial on Medium.
Install mailhog using Homebrew (if you don't have Homebrew installed, check out the instructions here: https://brew.sh/):
brew install mailhog
Open MAMP Pro and go to the “Postfix” tab. Make sure the checkbox next to “Include Postfix service in GroupStart” is checked.
Use these setting for Postfix:
Fill in your domain name in the field “Set domain of outgoing e-mails to:”
Check “Use a Smart host for routing”
“Server name:” is 127.0.0.1:1025 (this is the SMTP port Mailhog uses)
Set “Authentication” to “none”
Go to http://127.0.0.1:8025/ in your browser to see the mails sent by PHP.

PHP - Transfer file from Server to Windows PC

I have tried a few SSH and SCP snippets to transfer files from a web server to a windows pc and I can't quite get it working. There are a combination of things I believe I need such as firewall permissions, php modules, etc.
What boggles my mind is, it is so easy to ssh to a linux machine because I know the username and password but for Windows, you don't REALLY have a username and sometimes don't even have a password.
That being said, here is what I need to do. I have a linux server online and need to send a XML file to a windows pc. Out of your experiences, what are the best php modules, snippets, and any tips that you followed to achieve this? I believe the IP I would use for my windows machine would be my public ip but what in the world would the password be.. I have no pw on my computer? Do I need extra software installed on my windows pc as well?
Any help is appreciated.
Without getting into your IP potentially being dynamic.
It sounds like you need a cron job on the web server. You could then set up a FTP/SSH server on your Windows PC to receive the file.
On the other hand if this file is in a website folder which has FTP access. You could FTP to the server from your Windows pc and get the file with an FTP client.
Programs such as FTPBox could sync this for you or Curl from the command line.
With a command line program like Curl on your Windows PC you could set up a cron job on your Windows pc to automate getting this file if you want to do this automatically.
There are a few other options like a virtual linux machine on your windows pc. Then you could SSH from there and set up shared folders etc.
But to put it as simply as my experience has taken me.
If you have a webserver use FTPS and use a FTP client on your PC.
or use a command line program like Curl to automate from windows pc
From the server you need a cron job to automate the process, but you need to setup some type of server to receive this reliably. You could have a PHP file call a script file with php exec() depending on your webservers permissions.
Your router and software firewall may need to be configured to allow the ports you use for the transfer.
Easiest option is FTP server on webserver and FTP client on windows machine.
There are a few options, so I hope this has helped somewhat, I haven't taken into account a few things like security, automation, permissions etc. So none of these could be your best option. :)
Hope this helps a bit
Edit: Just to add Windows doesn't come with SSH which might explain some of the username/password issues. When you set up a FTP server on your Windows pc you can set your credentials
Here is a guide for setting up FTP Server on Windows PC
https://www.howtogeek.com/140352/how-to-host-an-ftp-server-on-windows-with-filezilla/
Once you have a server setup on your pc, if you wish to go down the route of a creating a cron job on your webserver for automation, you will havve your credentials from your server setup.

Windows XAMPP catch all PHP mail() in one local mailbox or folder

Using XAMPP on Windows I am developing a WordPress site and need to catch all outgoing emails into a single local mailbox or even a folder. I am testing a plugin that sends out emails, it would be easier to do this locally rather than updating the remote Linux server on every small change.
Any advice on the simplest way to do this?
I always use mailcatcher for this
Check http://block81.com/articles/test-emails-locally-with-mailcatcher for a tutorial

Do I need to install PHP, MySQL, and something like XAMP, if I already have an IDE, a webhost, and FTP client?

It seems like there are two ways to go, and the determining factor is whether you want to host on your own computer, or through a webhost.
If I have an IDE, a webhost server I subscribe to, and an FTP client to transfer my files to the server, then I don't need to install PHP, MySQL, and XAMP, right?
I know XAMP allows me make my computer website server.
When I install PHP, am I installing the intepreter for my computer/server to parse the .php files? (and same for MySQL?)
If I pay for web hosting, then their servers already have PHP and MySQL parsers, and all I need to do is upload my text files, right?
Thanks in advance
U just cant simply put the files in server without developing them.and if you want to develop any website or any webapp then u need to make your system a local server where you can execute your server side languages like php.XAMP is a short form for mysql,apache and php for windows.and 'website server' is not the proper word.use LOCALHOST instead because only u will have access to your server unless you are connected via LAN or WAN.so i can summarize the above in few points keeping in mind that you want to develop your website.
step 1:install XAMP
step 2:develop and test your scripts.
Step 3:if everything works fine than host your site in the webserver for everybody to see it.

devel WAMP stack with mail server and open SSL

I'm developing an application that requires testing email.
I'm currently using wampserver, but it doesn't come with a mail server and setting one up has been a pain.
Also if I use an external mail server like yahoo, I run into issues because wamp doesn't come with SSL which yahoo's mail server requires.
So I'm trying to save myself from all this headache. I'm looking for a new development environment that comes "out of the box" with a mailserver and open SSL. Clearly that's not wampserver2. What does?
As already said in your other question, XAMPP does.
Pretty much any reasonably popular Linux distro has these built-in.
As i said in another question - settle fake GMail account and use PHPMailer.
http://phpmailer.worxware.com/index.php?pg=exampleagmail

Categories