Yazılımcınıza aşağıdaki kodları verin yapacaktır.


function NETGSMMesajGonder($mesaj,$telefon){
$netgsmuser='BILGIYAZILACAK';
$netgsmpass='BILGIYAZILACAK';
$netgsmtitle='BILGIYAZILACAK';

$xmlData='<?xml version="1.0" encoding="UTF-8"?>
<mainbody>
<header>
<company dil="TR">Netgsm</company>
<usercode>'.$netgsmuser .'</usercode>
<password>'.$netgsmpass .'</password>
<type>1:n</type>
<msgheader>'.$netgsmtitle .'</msgheader>
</header>
<body>
<msg>
<![CDATA['.$mesaj.']]>
</msg>
<no>90'.$telefon.'</no>
</body>
</mainbody>';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://api.netgsm.com.tr/sms/send/xml');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
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);
$sonuc=explode(" ", $result);
return $sonuc[0];
}

$mesaj='BILGIYAZILACAK';
$telefon='BILGIYAZILACAK';
$gelen=NETGSMMesajGonder ($mesaj,$telefon);

if($gelen=="00"){
echo 'SMS gönderilmiştir.';
}