Search Engine: Elastic

Article ID: 3333, created on Nov 30, 2007, last review on May 11, 2014

  • Applies to:
  • H-Sphere


There are two way to test mail on web server:
1) via sendmail from command line
You need to put this command on command line on your web server:
# echo -e " \nSubject: Test mail from web\n\n Test mail from web via senmail\n" | sendmail -t -F

2) via php script from browser
Create the test php script on your web server in /hsphere/shared/apache/htdocs dir.
# vi /hsphere/shared/apache/htdocs/testmailfromweb.php
$to = "";
$subject = "Test mail from web";
$body = "Hi,\n\nTest mail from web via php script";
if (mail($to, $subject, $body)) {
echo(" <p>Message successfully sent! </p>");
} else {
echo(" <p>Message delivery failed... </p>");
The first argument to this function is the recipient, the second specifies the message's subject and the third one should contain the body. In your bowser put the following: http:///testmailfromweb.php

f213b9fa8759d57bee5d547445806fe7 3ef1f5f998c0dc182718a7fe4376f875

Email subscription for changes to this article
Save as PDF