IP santrallerde web sitesi üzerinden PHP ile SMS gönderme


20 January 2023 0:41
972

Paylaş

Geçenlerde bir arkadaşla konuşurken bir şirketten IP santral hizmeti aldığını ve bir web sitesi üzerinden, santrale ait API ile istediği kişilere kısa mesaj atıp atamayacağını sordu. IP santral hizmeti veren birçok firma sisteme ait API’lerini paylaşıyor zaten. Paylaşmayanlardan da uzak durun bence.

Neyse, aşağıda Netgsm operatörü ile bunu nasıl yapabileceğinizi gösteren basit bir PHP kod paylaşıyorum. İsteyen olursa github profilime attım, oradan da görebilirsiniz.

https://github.com/emrehakan-ai/netgsmphpsms.git

// SMS Göndermek istediğiniz numaraları virgülle ayırın.
$cepno = "543XXXXXXX,544XXXXXXX";

// NetGSM Santral Numaranızı yazın
   $cepnokullanici = "850XXXXXXX";
// NetGSM'den aldığınız passcode'ı yazın
   $cepnopass = "XXXXXXXX";
// SMS Mesajı
   $mesajyaz ="Göndermek istediğiniz SMS Mesajı buraya gelecek";

    $url= 'https://api.netgsm.com.tr/sms/send/get/?usercode='.$cepnokullanici.'&password='.$cepnopass.'&gsmno='.$cepno.'&message='.$mesajyaz.'&msgheader=İzinli SMS Başlığı Buraya Yazılacak';
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $http_response = curl_exec($ch);
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

  if($http_code != 200){
    return false;
  }
    $balanceInfo = $http_response;
   echo 'Mesaj Gönderildi'
  return $balanceInfo;

 } else {

 }



5 1 vote
Değerlendirme
Subscribe
Notify of
0 Yorum
Oldest
Newest Most Voted
Inline Feedbacks
View all comments




copyright 2025 | Gizlilik Politikası | emrehakan.com