send sms using php script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramanagosu
    New Member
    • Mar 2009
    • 9

    send sms using php script

    Hi, any one help me

    here i am attaching source code to send sms using php code it show the message "message sent successfully " but message is not delivered

    code:

    Code:
    <?
    # 10 digit number .. can get it from a form using post method
    
    
    $from="91xxxxxxxxxxxx@ri.irisme.net";
    
    # convert it to an email format
    $to="91xxxxxxxxx@ri.irisme.net";
    $subject="hi";
    
    # message body .. can get it from a form using post method
    $body = @$_POST['message'];
    $header= "From:". $from."\r\n";
    $header.= "X-Mailer: PHP/". phpversion();
    
    if (mail($to,$subject,$body,$header,"-f $from"))
    {
    echo "To: $to \n" . "<br>";
    echo "From: $from \n" . "<br>";
    echo "Message: $body \n";
    echo "message sent successfully.";
    }
    else
    {
    echo "Message delivery failed…\n";
    }
    ?>
    please give me reply

    Thanks in advance
    Ramana
    Last edited by Markus; Mar 13 '09, 11:34 AM. Reason: Added [code] tags.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    If mail() is returning true, then I'd assume the email is being sent. That being said, I suspect it's the mail server 'ri.irisme.net' is not forwarding the sms.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      In fact, browsing to ri.irisme.net gives me an error - page not found. So .. just a guess .. maybe that's why it's not working?

      Comment

      • ramanagosu
        New Member
        • Mar 2009
        • 9

        #4
        if i am avoid the "ri.irisme. net" is it working fine
        tell me any modifications

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by ramanagosu
          if i am avoid the "ri.irisme. net" is it working fine
          tell me any modifications
          Try sending the mail to a valid email address?

          Comment

          • kartikt
            New Member
            • Aug 2009
            • 1

            #6
            This script works fine but on the message recieved, the first line is host107.bluehos t.com and then the message starts.

            Is there a way to remove the host provider email as it could be a security threat ?

            Comment

            Working...