"Enter"a basıp içeriğe geçin

Web Kancası Yardımıyla SMS Gönderimi

Web Kancası Yardımıyla SMS Gönderimi

Bir program veya web sistemi kullanıyorlar çeşitli sebeplerden veya uyarılardan dolayı kişilere toplu sms gönderimi yapmanız gerekebilir.
Bu durum için netgsm üzerinden bir sistem yazdım işinizi görecektir. $telefon1 değişkenini 1-2-3 diye arttırma şansına sahipsiniz.

<?php
date_default_timezone_set(‘Europe/Istanbul’);

function XMLPOST($PostAddress,$xmlData)

{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$PostAddress);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array(“Content-Type: text/xml”));
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlData);
$result = curl_exec($ch);
return $result;
}

$mesaj = ‘sistem uyarisi lutfen kontrol edin’;

$telefon1 = ‘90537xxxxxxx’; //1.kisi

 

$xml='<?xml version=”1.0″ encoding=”iso-8859-9″?>
<mainbody>
<header>
<company>NETGSM</company>
<usercode>537xxxxx</usercode>
<password>sifreniz</password>
<startdate></startdate>
<stopdate></stopdate>
<type>1:n</type>
<msgheader>0850302xxxxx</msgheader>
</header>
<body>
<msg><![CDATA[‘.$mesaj.’]]></msg>
<no>’.$telefon1.'</no>
</body>
</mainbody>’;


$gelen=XMLPOST(‘http://api.netgsm.com.tr/xmlbulkhttppost.asp’,$xml);
?>