i have a code which Send updates to members in my site to their email Address.
it working all the time,Suddenly i noticed its no longer working..
what might be the Course of this....
i used the function to send different updates to members and in all the sectors its not working))

help me to overcome this.
here is the script:

$from="From:shule@shule.com\r\n";
$to="$email";
$subject="$loggain Accepted your friend request on Kislat.Com ";
$content="$loggain Accepted your friend request on Kislat.Com  
to view your friend click http://www.shule.com";
//$password=$_POST['password'];
if($content){
mail($to, $subject, $content,$from);

echo"Your accepted a  friend         request";

}

Recommended Answers

All 4 Replies

Dear,

Following code might help you.

<?php
include("Mail.php");

$mto=$_REQUEST["to"];
$mfrom=$_REQUEST["from"];
$msubject=$_REQUEST["subject"];
$mbody=$_REQUEST["body"];
$mcmd=$_REQUEST["cmd"];

if(isset($mto,$mfrom,$msubject,$mbody,$mcmd))
  {
    $recipients = $mto;
    $headers["From"]=$mfrom;
    $headers["To"]="info@adatapost.com";
    $headers["Subject"]=$msubject;
    $body=$mbody;
	
	# SMTP parameters - Mail accountname/port/username/password
    $params["host"] = "mail.adatapost.com";
    $params["port"] = "25";
    $params["auth"] = true;
    $params["username"] = "info@adatapost.com";
    $params["password"] = "password";

     $mail_object =& Mail::factory("smtp", $params);
     $mail_object->send($recipients, $headers, $mbody);
	 print "Mail Sent";
	}
	else
	   print "Fill the fields";
?>
<form method="post" action="sample.php">
    <table border="1" width="300">
	   <tr>
	      <td>From</td>
		  <td><input type="text" name="from"/></td>
	   </tr>
	   <tr>
	      <td>To</td>
		  <td><input type="text" name="to"/></td>
	   </tr>
	  <tr>
	      <td>Subject</td>
		  <td><input type="text" name="subject"/></td>
	   </tr>
   	  <tr>
	      <td>Message</td>
		  <td>
		  <textarea name="body"></textarea>
		  </td>
	   </tr>
   	  <tr>
		  <td colspan="2" align="center">
             <input type="submit" name="cmd" value="Submit"/>
		  </td>
	   </tr>
	</table>
</form>

thankx i`m testing it.....

thankX ....the script helped to solve the Problem)))

thankx i`m testing it.....

and dont' forget to add reputation point.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.