Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello friends ,

i am trying to do Send SMS from my web application, but getting error at single line sms

The remote server returned an error: (403) Forbidden.


, please suggest me ..

thanks in advance



C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Net;
using System.IO;
using ASPSnippets.SmsAPI;


public partial class CS : System.Web.UI.Page
{
    protected void btnSend_Click(object sender, EventArgs e)
    {
        SMS.APIType = SMSGateway.Site2SMS;
        SMS.MashapeKey = "<Mashape API Key>";
        SMS.Username = txtNumber.Text.Trim();
        SMS.Password = txtPassword.Text.Trim();
        if (txtRecipientNumber.Text.Trim().IndexOf(",") == -1)
        {
            //Single SMS
            SMS.SendSms(txtRecipientNumber.Text.Trim(), txtMessage.Text.Trim());
        }
        else
        {
            //Multiple SMS
            List<string> numbers = txtRecipientNumber.Text.Trim().Split(',').ToList();
            SMS.SendSms(numbers, txtMessage.Text.Trim());
        }
    }
}
Posted
Updated 10-Feb-15 1:04am
v2
Comments
Kornfeld Eliyahu Peter 10-Feb-15 6:23am    
What error?
Mr.VJ 10-Feb-15 7:03am    
this error :

The remote server returned an error: (403) Forbidden.

1 solution

Error 403 means that the server is refusing to serve the request. It's possible that your account has been blocked, but you would need to contact the server admins to find out if that's the case.

The best place to ask questions about an article is in the comments section for the article. The person who wrote the code is the person most likely to be able to help you with it!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900