Hello, Need some help in PHP callback i mean there is php file called test.php when it will communication with a API server such as http://www.myexample.com/test.php?ip=xxx-xxx-xxx-xxx&pass=[some generated password for login]&email=myemail@gmail.com what i want is the when a call back is done your own site test.php will email to your mail with the content of [some generated password for login] So can anyone say what code should be inside the test.php so that it can get the generated password and send to the mail ID. Regards
$password = $_GET['pass']; if(mail($to, $subject, $message, $headers, $returnpath)) { //echo that mail was sent } else { //echo that there was a problem sending mail } PHP:
Please correct me whether i am saying wrong or correct $password = $_GET['pass']; $to = "me@gmail.com"; $subject = "Your Password"; $message = $password; if(mail($to, $subject, $message, $headers, $returnpath)) { //echo that mail was sent } else { //echo that there was a problem sending mail } PHP: Regards
Almost! You still need your $headers variable, though. Try using these, for starters: $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "To: ".$_GET['username'] ."<me@gmail.com>"."\r\n"; $headers .= "From: Warez Dominator"."\r\n"; PHP: That will allow you to even send HTML in your email!