GetAddress Method  
 

Get the email address associated with the specified phone number.

Syntax

object.GetAddress( PhoneNumber, Address )

Parameters

PhoneNumber
A string value which specifies the phone number of the mobile device. This can be a standard E.164 formatted number or an unformatted number. Any extraneous whitespace, punctuation or other non-numeric characters in the string will be ignored.
Address
A string that will contain the email address associated with the specified phone number when the method returns. A mail message sent to this address will be forwarded to the mobile device as a text message. This parameter must be passed by reference.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure. If the method fails, the value of the LastError property can be used to determine cause of the failure.

Remarks

The GetAddress method can be used to determine if a phone number is associated with a mobile device and obtain the email address for the wireless service provider's gateway. This is done by sending an query to a server that will check the phone number against a database of known providers and the phone numbers that have been allocated for wireless devices.

By default, this method will attempt to automatically determine which service provider is associated with the phone number. If the service provider cannot be determined, this method will fail and return an error code. If the Provider property has been set to to the name of a specific service provider, that provider will be used to determine the gateway email address.

This method sends an HTTP query to the server api.sockettools.com to obtain information about the phone number and wireless service provider. This requires that the local system can establish a standard network connection over port 80. If the client cannot connect to the server, the method will fail and an appropriate error will be returned. The server imposes a limit on the maximum number of connections that can be established and the maximum number of requests that can be issued per minute. If this method is called multiple times over a short period, the control may also force the application to block briefly. Server responses are cached per session, so calling this method multiple times using the same phone number will not increase the request count.

See Also

Provider Property, ProviderCount Property, ProviderName Property, GetProvider Method, SendMessage Method