Guest
2009-03-19T10:02:14Z
Hey,
I've just subscribed to the 5 free SMS messages. I am creating a website for educational purposes and i am using the following code below to send SMS.


            IntelliSMS objIntelliSMS = new IntelliSMS();

            objIntelliSMS.Username = "username";
            objIntelliSMS.Password = "password";

            String MobileNo=(Session["mobile"].ToString());

            String Message = ("Thank you " + Session["full_name"].ToString() + ".Your taxi has been accepted by " + Session["company_name"].ToString() + ". If you want to cancel then please contact the taxi company on " + Session["phone"].ToString() + "."); 
            String Companyname = ("Just-Taxis.co.uk");

             objIntelliSMS.SendMsg (MobileNo,Message,Companyname);

Now i keep receiving an error saying:-

System.NullReferenceException: Object reference not set to an instance of an object.

Does anybody know what the problem is?
Support
2009-03-19T11:05:53Z
Please try and get your code working without using Session variables (i.e. hard coding the values).

If this works then this would mean that there is an issue with the way you are using Session variables in your web application.
Guest
2009-03-19T13:35:49Z
The code does work without using the Session variables but i wanted it this way as it is what i am trying to acheive.. Is there any way i can make it work by using session variables..?
Support
2009-03-19T13:41:41Z
I am please that it does work when you take out the Session code.

Your issue with Session variables is a general .Net Devlopement inssue (i.e. not specific to our API), and therefore not directly relavent to this forum. Please direct your question to general .Net forum found on other websites where they may be able to help you.
Guest
2009-03-19T13:45:00Z
Thanks will do.