问题
How to test "Contact us" page that takes form input, action = "send.php" which consists of mail function? I am using Xampp on Mac OS El capitan. No mail is received in the gmail inbox!
回答1:
You can use PHPMailer class with SMTP.
Please visit PHPMailer SMTP Example
You can use Gmail SMTP server.
In this way you don't have to setup Mail Server on your OSX/Windows.
回答2:
First of all, you cannot send emails to Gmail from your local computer. Unless you have a SMTP server setup, if you want to test an email form I suggest you to setup MailCatcher on your system https://mailcatcher.me.
Once installed you should be able to debug the emails you sent from the form when everything is ready, you can be sure that the form will also work online (unless something is wrong with the server).
来源:https://stackoverflow.com/questions/36910789/form-to-email-xampp-php-javascript-mac-os