PHP mail function not working on CentOS server with WHM, testing in browser. | Free VPS

9:37:00 AM


I configured LAMP server in VPS server, I tried to run PHP mail function in web browser, but it was not working in the 1st attempt. Later, I solved the issue.

1. Login to WHM with username and password.


2. Go to Server Configuration => Tweake Setting.


3.  In side the Tweake Settings go to Mail option,  change the 'Prevent �nobody� from sending mail' to Off Default Mode.




4. Create the PHP mail function script in the Document root "test.php".

<?php
  $to = "Destination mail ID";
  $message = "Hello World";
  $subject = "User Activated";
  $headers = 'MIME-Version: 1.0' . "\r\n";
  $headers = 'Content-type: test/html; charset=iso-8859-1' . "\r\n";

  //Additional Header
  $headers = 'From: Easyship <info@easyshipping.com>' . "\r\n";
  
  //send email
  mail($to, $subject, $message, $header);
  
  //Email response
  dir ("Reach Here"); 
?>

5. Go to web browser and test the PHP mail function script in browser.
    URL:-    http://IP Address/~easy/easyshipping/test.php    or   DomainName/test.php
     

6. If there is no error, go to the mail box and check for php test mail.



That's it...






Artikel Terkait

Previous
Next Post »

1 komentar:

Write komentar
lilly wise
AUTHOR
March 14, 2020 at 5:24 AM delete

I really impressed after read this because of some quality work and informative thoughts . I just wanna say thanks for the writer and wish you all the best for coming!.
Free vps

Reply
avatar