I’ve just order a Cloud and is setting my virtual server on that cloud. After installed LAMP (Apache, MySQL and PHP) on CentOS server, I continue to check whether the PHP mail() function is working.
Below is the content of the test email PHP file. It’s just for testing purpose so the recipient is hard code without any email format validation.
Note: please replace the “[email protected]” on line 2 with your real email address.
<?php $to = "[email protected]"; $subject = "Hello, it is a test email"; $body = "Congratulation! The PHP Mail function is working"; if (mail($to, $subject, $body)) { echo("<p>Message is sent successful!</p>"); } else { cho("<p>Message delivery failed...</p>"); } ?> |