Click or drag to resize
ZenophSMSaddRecipient Method (String)
Adds a phone number to the destinations list. If the phone number already exists, it will be ignored.

Namespace: Zenoph.SMSLib
Assembly: Zenoph.SMSLib (in Zenoph.SMSLib.dll) Version: 2015.9.30.0 (2015.09.30.0)
Syntax
public bool addRecipient(
	string phonenum
)

Parameters

phonenum
Type: SystemString
The phone number to be added to the destinations list.

Return Value

Type: Boolean
Returns true if the phone number was added, otherwise it returns false.
Exceptions
ExceptionCondition
Exception Thrown if phonenum is invalid or when not allowed on user routes.
Remarks

The phone number can be in local or international format. When phonenum is specified in local number format, the default international dial code for user account will be prepended to the phone number to make it international.

If phonenum is invalid or not allowed on user routes, Exception will be thrown. To ignore the throwing of Exception when phonenum is invalid or not allowed on user routes, use addRecipient(String, Boolean) and pass true as the second argument to the method call.

Examples
// Initialise SMS object and perform authentication.
ZenophSMS sms = new ZenophSMS();
sms.setUser("account_login");
sms.setPassword("account_password");
sms.authenticate();

// add destinations. (assume default international dial code is +233)
sms.addRecipient("0237898985");      // becomes 233237898985
sms.addRecipient("233235812323");
sms.addRecipient("+233236224233");   // becomes 233236224233
sms.addRecipient("0023323877444");   // becomes 233238774445
See Also