Source for file vodafoneitaly_smtp.php
Documentation is available at vodafoneitaly_smtp.php
* Net_SMS_vodafoneitaly_smtp Class implements the SMTP API for accessing the
* Vodafone Italy SMS gateway. Use of this gateway requires an email account
* with Vodafone Italy (www.190.it).
* Copyright 2003-2009 The Horde Project (http://www.horde.org/)
* Copyright 2003-2007 Matteo Zambelli <mmzambe@hotmail.com>
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
* $Horde: framework/Net_SMS/SMS/vodafoneitaly_smtp.php,v 1.25 2008/01/02 11:12:11 jan Exp $
* @author Marko Djukic <marko@oblo.com>
* @author Matteo Zambelli <mmzambe@hotmail.com>
* @param array $params Parameters.
* An array of capabilities, so that the driver can report which operations
* it supports and which it doesn't. Possible values are:<pre>
* auth - The gateway require authentication before sending;
* batch - Batch sending is supported;
* multi - Sending of messages to multiple recipients is supported;
* receive - Whether this driver is capable of receiving SMS;
* credit - Is use of the gateway based on credits;
* addressbook - Are gateway addressbooks supported;
* lists - Gateway support for distribution lists.
* This function does the actual sending of the message.
* @param array $message The array containing the message and its send
* @param string $to The recipient.
* @return array An array with the success status and additional
protected function _send($message, $to)
/* Since this only works for Italian numbers, this is hardcoded. */
if (preg_match('/^.*?<?(\+?39)?(\d{10})>?/', $to, $matches)) {
$headers['From'] = $this->_params['user'];
$to = $matches[2 ] . '@sms.vodafone.it';
$result = $this->mail->send ($to, $headers, $message['text']);
if (is_a($result, 'PEAR_Error')) {
return array (0 , $result->getMessage ());
return array (0 , _("You need to provide an Italian phone number"));
* Identifies this gateway driver and returns a brief description.
* @return array Array of driver info.
'name' => _("Vodafone Italy via SMTP"),
'desc' => _("This driver allows sending of messages via SMTP through the Vodafone Italy gateway, only to Vodafone numbers. It requires an email account with Vodafone Italy (http://www.190.it)."),
* Returns the required parameters for this gateway driver.
* @return array Array of required parameters.
return array ('user' => array ('label' => _("Username"),
* Returns the parameters that can be set as default for sending messages
* using this gateway driver and displayed when sending messages.
* @return array Array of parameters that can be set as default.
* Returns the parameters for sending messages using this gateway driver,
* displayed when sending messages. These are filtered out using the
* default values set up when creating the gateway.
* @return array Array of required parameters.
* @todo Would be nice to use a time/date setup rather than minutes from
* now for the delivery time. Upload field for ringtones/logos?
Documentation generated on Mon, 11 Mar 2019 15:57:16 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|