Les dejo un codigo que hice en algun momento, para enviar sms desde php. el funcionamiento es sencillo ya que envia un mail. Actualmente esta con problemas con Personal, no se porque no funca.. creo que ha de ser por la direccion de mail. Si lo quieren probar esta en
Sin-Etiketa
Consta de 2 Archivos.
index.php
--------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="" content="text/html; charset=iso-8859-1">
<link href="main.css" rel="stylesheet" type="text/css">
<meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"></head>
<body>
<form action="enviasms.php" method="get" name="enviamensaje" id="enviamensaje">
<p align="center"><font color="#3E7B7B" size="4" face="Georgia, Times New Roman, Times, serif"><strong>Envio
de SMS</strong></font></p>
<table width="69%" border="0" align="center" cellpadding="0" cellspacing="0" class="RecuadroTabla">
<tr>
<td width="47%" class="texto"><div align="right">Numero de Celular</div></td>
<td width="5%"> </td>
<td width="48%"><input name="numerocel" type="text" class="textbox" id="numerocel" size="40"></td>
</tr>
<tr>
<td class="texto"><div align="right">Empresa</div></td>
<td> </td>
<td><select name="empresa" class="textbox" id="select">
<option value="01">Argentina - PERSONAL: (ca + nº sin 0 ni 15)</option>
<option value="02">Argentina - CTI: (ca + nº sin 0 ni 15)</option>
<option value="06">Argentina - VOMISTAR: (ca + nº sin 0 ni 15)</option>
<option value="07">Argentina - NEXTEL: (ca + nº sin 0 ni 15)</option>
<option value="08">Argentina - SKYTEL: (ca + nº sin 0 ni 15)</option>
<option value="09">Argentina - CONECTEL: (ca + nº sin 0 ni 15)</option>
</select></td>
</tr>
<tr>
<td class="texto"><div align="right">Tu Nombre</div></td>
<td> </td>
<td><input name="nombre" type="text" class="textbox" id="nombre2" size="40">
</td>
</tr>
<tr>
<td valign="top" class="texto"><div align="right">Mensaje</div></td>
<td rowspan="2"> </td>
<td rowspan="2"><textarea name="mensajeenv" cols="35" class="textbox" id="mensajeenv"></textarea></td>
</tr>
<tr>
<td><div align="right"></div></td>
</tr>
<tr>
<td height="23"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input name="Submit" type="submit" class="boton" value="Enviar SMS">
</div></td>
</tr>
</table>
</form>
<table width="523" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="442" height="41" valign="top"><script type="text/javascript"><!--
google_ad_client = "pub-4585830780992367";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_cpa_choice = "CAEQwLzqhwIQyLvqhwIQhLzqhwIQjLvqhwIQ_PK28QEQuPO28QEQ9PO28QEQ4LjqhwIQ2LnqhwIQlLrqhwIQ0LrqhwIaCOq5OIA5HeXNKIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfg";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </td>
</tr>
</table>
<p> </p>
</body>
</html>
enviasms.php
--------------------------------------------------------------------------------------------------------------------
<?php
$emailenvia ="[email protected]"; /* Direccion de correo que envia */
$empresasms= $_GET['empresa']; /* Recibo la Empresa del dest */
$numero= $_GET['numerocel']; /* el numero del cel */
$mensaje= $_GET['mensajeenv'];
/* VERIFICO LA EMPRESA Y SELECCIONO EL SERVER */
/*
Movistar
@sms.movistar.net.ar
@e-mocion.net.ar (creo que ya no está activo) ex unifon
@movimensaje.com.ar (creo que ya no está activo) ex movicom
Personal
@personal-net.com.ar
CTI @infotext.cti.com.ar (creo que ya no está activo)
@sms.ctimovil.com.ar
Conectel
@conectel.com.ar
Nextel
@nextel.net.ar
Skytel
@skytel.com.ar
//Para Personal // */
if ($empresasms=="01" ) {
$server= 'personal-net.com.ar';
}
if ($empresasms == "02" ) {
$server= 'sms.ctimovil.com.ar';
}
if ($empresasms == "06" ) {
$server= 'sms.movistar.net.ar';
}
if ($empresasms == "07" ) {
$server= 'nextel.net.ar';
}
if ($empresasms == "08" ) {
$server= 'skytel.com.ar';
}
if ($empresasms == "09" ) {
$server= 'conectel.com.ar';
}
$mensaje = wordwrap($mensaje, 100);
echo $mensaje;
$destinatario = $numero.'@'.$server;
$para = $destinatario;
$asunto = 'CiberCentro SMS';
$cabeceras = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/';
mail($para, $asunto, $mensaje, $cabeceras);
$texto= $destinatario. '<br>'. $mensaje ;
mail('[email protected]','SMS ENVIADO!!!',$texto,'FROM: $emailenvia');
echo 'El mensaje fue enviado!!! a '.$destinatario;
?>
espero les guste...
estoy trabajando en otra version para que detecte la empresa automaticamente... cuando salga mando el codigo... si es que va este tipo de post....
Consta de 2 Archivos.
index.php
--------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="" content="text/html; charset=iso-8859-1">
<link href="main.css" rel="stylesheet" type="text/css">
<meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"><meta http-equiv="" content="text/html; charset=iso-8859-1"></head>
<body>
<form action="enviasms.php" method="get" name="enviamensaje" id="enviamensaje">
<p align="center"><font color="#3E7B7B" size="4" face="Georgia, Times New Roman, Times, serif"><strong>Envio
de SMS</strong></font></p>
<table width="69%" border="0" align="center" cellpadding="0" cellspacing="0" class="RecuadroTabla">
<tr>
<td width="47%" class="texto"><div align="right">Numero de Celular</div></td>
<td width="5%"> </td>
<td width="48%"><input name="numerocel" type="text" class="textbox" id="numerocel" size="40"></td>
</tr>
<tr>
<td class="texto"><div align="right">Empresa</div></td>
<td> </td>
<td><select name="empresa" class="textbox" id="select">
<option value="01">Argentina - PERSONAL: (ca + nº sin 0 ni 15)</option>
<option value="02">Argentina - CTI: (ca + nº sin 0 ni 15)</option>
<option value="06">Argentina - VOMISTAR: (ca + nº sin 0 ni 15)</option>
<option value="07">Argentina - NEXTEL: (ca + nº sin 0 ni 15)</option>
<option value="08">Argentina - SKYTEL: (ca + nº sin 0 ni 15)</option>
<option value="09">Argentina - CONECTEL: (ca + nº sin 0 ni 15)</option>
</select></td>
</tr>
<tr>
<td class="texto"><div align="right">Tu Nombre</div></td>
<td> </td>
<td><input name="nombre" type="text" class="textbox" id="nombre2" size="40">
</td>
</tr>
<tr>
<td valign="top" class="texto"><div align="right">Mensaje</div></td>
<td rowspan="2"> </td>
<td rowspan="2"><textarea name="mensajeenv" cols="35" class="textbox" id="mensajeenv"></textarea></td>
</tr>
<tr>
<td><div align="right"></div></td>
</tr>
<tr>
<td height="23"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input name="Submit" type="submit" class="boton" value="Enviar SMS">
</div></td>
</tr>
</table>
</form>
<table width="523" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="442" height="41" valign="top"><script type="text/javascript"><!--
google_ad_client = "pub-4585830780992367";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_cpa_choice = "CAEQwLzqhwIQyLvqhwIQhLzqhwIQjLvqhwIQ_PK28QEQuPO28QEQ9PO28QEQ4LjqhwIQ2LnqhwIQlLrqhwIQ0LrqhwIaCOq5OIA5HeXNKIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfiiM8Op-KIzw6n4ojPDqfg";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </td>
</tr>
</table>
<p> </p>
</body>
</html>
enviasms.php
--------------------------------------------------------------------------------------------------------------------
<?php
$emailenvia ="[email protected]"; /* Direccion de correo que envia */
$empresasms= $_GET['empresa']; /* Recibo la Empresa del dest */
$numero= $_GET['numerocel']; /* el numero del cel */
$mensaje= $_GET['mensajeenv'];
/* VERIFICO LA EMPRESA Y SELECCIONO EL SERVER */
/*
Movistar
@sms.movistar.net.ar
@e-mocion.net.ar (creo que ya no está activo) ex unifon
@movimensaje.com.ar (creo que ya no está activo) ex movicom
Personal
@personal-net.com.ar
CTI @infotext.cti.com.ar (creo que ya no está activo)
@sms.ctimovil.com.ar
Conectel
@conectel.com.ar
Nextel
@nextel.net.ar
Skytel
@skytel.com.ar
//Para Personal // */
if ($empresasms=="01" ) {
$server= 'personal-net.com.ar';
}
if ($empresasms == "02" ) {
$server= 'sms.ctimovil.com.ar';
}
if ($empresasms == "06" ) {
$server= 'sms.movistar.net.ar';
}
if ($empresasms == "07" ) {
$server= 'nextel.net.ar';
}
if ($empresasms == "08" ) {
$server= 'skytel.com.ar';
}
if ($empresasms == "09" ) {
$server= 'conectel.com.ar';
}
$mensaje = wordwrap($mensaje, 100);
echo $mensaje;
$destinatario = $numero.'@'.$server;
$para = $destinatario;
$asunto = 'CiberCentro SMS';
$cabeceras = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/';
mail($para, $asunto, $mensaje, $cabeceras);
$texto= $destinatario. '<br>'. $mensaje ;
mail('[email protected]','SMS ENVIADO!!!',$texto,'FROM: $emailenvia');
echo 'El mensaje fue enviado!!! a '.$destinatario;
?>
espero les guste...
estoy trabajando en otra version para que detecte la empresa automaticamente... cuando salga mando el codigo... si es que va este tipo de post....