Jump to content


This topic is now archived and is closed to further replies.


mail function error

Recommended Posts

Hello guys

PHP is a new language for me.
I had created a simple form which sends information to user via mail
for this i m using mail() function
But its showing me error.
The error show following message

Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for rajesh@softcellsolutions.com in C:\PHP\inquiry.php on line 40

Please help me to sort it out.

Here is the code :-


<title>My Form</title>
<div align="center"><font color="red"><H1>INQUIRY FORM</H1></font></div>
<form action="inquiry.php" method="post">
<b>What is your Name:</b><input type="text" name="name"><br>
<b>Sex:</b> Male<input type="radio" name="sex" value="male"> Female<input type="radio" name="sex" value="female"><br>
<b>Age:</b><input type="text" name="age" size="2"><br>
<b>Select your Favorite Game:</b>
<select name="game" >
<option>Basket Ball</option>
<b>Your Mail ID:</b><input type="text" name="mail"><br>
<input type="submit" value="SUBMIT">




$error[]="Please enter a name";
$error[]="Please select your sex";
$error[]="Please select a game";
$error[]="Please enter your age";
$error[]="Please enter your email id";
print("<font color=#F24A2D><h1>There is An error Occured in Entering Data !!!!!!</h1></font>");
print("<b>Please go<a href=form.html> back</a> and complete your form</b>");
print("<div align=center><font color=#8B4396><h1>$n Your entered information is:</h1></font></div>");
print("Your Name is:".$name."<br>");
print("Your Sex is:".$sex."<br>");
print("Your Age is:".$age."<br>");
print("Your Favorite Game:".$game."<br>");
print("Your mail ID:".$mail."<br>");

Share this post

Link to post
Share on other sites
It has nothing to do with your PHP code. You either have to A) Allow relaying from localhost or b) Change or allow the e-mail address you have in your "From" address. This is an server administration issue, not PHP.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.