The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::SMS::ViaNett - Perl Interface to Vianett HTTP API

SYNOPSIS

    use Net::SMS::ViaNett;


    my $obj = Net::SMS::ViaNett->new( username => $username, password => $password );
    if( $obj->send( to => $phone, msg => $message ) ) {
      print "Sent";
    } else {
      print "Not Sent";
    }

DESCRIPTION

Vianett ( http://www.vianett.com ) offers commercial service for sending / recieving SMS amongst other services. This module offers a convinient way to send SMS using ViaNett's API.

ViaNett offers various ways to contact their API, this module uses their HTTP API.

ViaNett's API documentation can be found at http://sms.vianett.com/cat/29.aspx

Please take note that neither this software nor the author are related to ViaNett in any way.

METHODS

new

Creates the Net::SMS::ViaNett Object

Usage:

  my $vianett = Net::SMS::ViaNett->new( username => $username, password => $password );

The complete list of arguments is:

  username  : The username that is given by Vianett
  password  : The password that is given by Vianett
agent

Sets/Gets User-Agent String to be sent to ViaNett during the HTTP Request

Usage:

  # Gets Current User-Agent String 
  $vianett->agent;   

  # Sets User-Agent String
  $vianett->agent( 'Spider Monkey' );
send

Sends the message through ViaNett's API

Usage:

    $vianett->send( to => $number, msg => $message );

    $vianett->send( to => $number, msg => $message, from => $source );

send method accepts following arguments

    to          - Destination number
    from        - Originator number 
    msg         - The message you want to send
    origin      - Alpha numeric originator number. Can only be used with messages with pricegroup=0
    operator    - The operator ID. Use 0 if this number is unknown.
    refno       - Message reference number. This number must be a unique ID.
    pricegroup  - The pricegroup. Example: 100 is NOK 1,- and 1500 is NOK 15,-.
    header      - The Optional Message Header

return 1 on success and 0 on failure

AUTHOR

Venkatakrishnan Ganesh <gvenkat@cpan.org>

COPYRIGHT

Copyright (c) 2009 Venkatakrishnan Ganesh. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This software or the author aren't related to ViaNett in any way.