NAME

WebService::Google::Voice::SendSMS - Send a SMS using Google Voice

VERSION

This document describes version 1.002 of WebService::Google::Voice::SendSMS, released February 21, 2015.

SYNOPSIS

use WebService::Google::Voice::SendSMS;

my $sender = WebService::Google::Voice::SendSMS->new(
  $email_address, $password
);

$sender->send_sms($phone_number => $message);

DESCRIPTION

WebService::Google::Voice::SendSMS allows you to send SMS messages using your Google Voice account (https://www.google.com/voice). It only works if you're able to send SMS messages from the Google Voice website. There should be a TEXT button next to the CALL button in the upper left corner. If that doesn't work, then SendSMS won't work either.

METHODS

new

$s = WebService::Google::Voice::SendSMS->new($username, $password);

Create a new SendSMS object. This does not perform any network request. Pass the $username (e.g. your.name@gmail.com) and $password you use to login to your Google Voice account.

send_sms

$success = $s->send_sms($phone_number, $message);

Send an SMS saying $message to $phone_number. The SMS will be sent by your Google Voice phone number. $success is true if the message was accepted by Google Voice (which does not necessarily mean that it was successfully delivered to the intended recipient).

SEE ALSO

Google::Voice is a much more complete API for Google Voice. However, I was unable to get it to login successfully.

WebService::Google::Voice::SendSMS is heavily based on http://code.google.com/p/phpgooglevoice/ by LostLeon. It started life as a Perl translation of the PHP code, but it's been refactored substantially since then.

DIAGNOSTICS

SendSMS: HTTP request failed: %d %s

This indicates that we received an HTTP error after sending a request to Google. The HTTP status code and message are included. The most common error is 403 Forbidden, which indicates that you've used the wrong username or password.

SendSMS: Unable to find %s in response

This indicates that the response we got from Google did not look like what we expected. Perhaps Google has changed their website. Look for an updated version of WebService::Google::Voice::SendSMS. If no update is available, report a bug.

CONFIGURATION AND ENVIRONMENT

WebService::Google::Voice::SendSMS uses LWP::UserAgent for sending requests to Google Voice, so it's influenced by the environment variables that configure that (especially the SSL options).

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

WebService::Google::Voice::SendSMS can only send SMS messages. It can't receive them, retrieve the history of sent messages, or access any other Google Voice features.

Troubleshooting

If WebService::Google::Voice::SendSMS doesn't work for you, the first thing to check is that you can send a SMS message by logging in to the Google Voice website in your browser. If that doesn't work, you'll have to try to work the problem out with Google.

If you're getting a HTTP 403 (Forbidden) error, then you may have supplied the wrong username or password. If those are correct, you may need to log in to your Google account and enable "Access for less secure apps". To do that, go to https://google.com, log in if necessary, click your username in the upper right corner, click Account, click Security, and make sure it says Enabled next to "Access for less secure apps". If it doesn't, click Settings and change it. (If anyone knows how this module can use a more secure login method, I'd be happy to hear about it.)

If it's still not working, please install the Smart::Comments module, uncomment the use Smart::Comments line at the beginning of this module, and include the debugging output in your bug report. (Be sure to sanitize your password.)

AUTHOR

Christopher J. Madsen <perl AT cjmweb.net>

Please report any bugs or feature requests to <bug-WebService-Google-Voice-SendSMS AT rt.cpan.org> or through the web interface at http://rt.cpan.org/Public/Bug/Report.html?Queue=WebService-Google-Voice-SendSMS.

You can follow or contribute to WebService-Google-Voice-SendSMS's development at https://github.com/madsen/webservice-google-voice-sendsms.

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Christopher J. Madsen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.