Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7953779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:14:04+00:00 2026-06-04T03:14:04+00:00

i want to sent SMS from my JAVA APPLICATION in the following format: NAME:

  • 0

i want to sent SMS from my JAVA APPLICATION in the following format:
NAME: Customer Name
ConfNO: 1234
Date: 2012-05-15
NoOfPax: Seven
Since i am using external sms gateway i need to post it as URL from the application. When i recive the SMS i dont see line breaks instead the text display \n. Please help.My Code is

String senderid = "SMSALERT";
    String to = "97112345678";
    String text = "Reservation INFO\nName:Customer Name\nConfNO: KN1234\nTime: 12:00PM\n#Pax:5\nThank You for Choosing US";
    String type = "text";
    String ppgHost = "www.yahoo.com";
    String username = "username";
    String password = "password";
    String datetime = "2012-05-15 12:00:00";
    String path = "index.php";
    try {
        HttpClient httpClient = new DefaultHttpClient();
        List<NameValuePair> qparams = new ArrayList<NameValuePair>();
        qparams.add(new BasicNameValuePair("username", username));
        qparams.add(new BasicNameValuePair("password", password));
        qparams.add(new BasicNameValuePair("senderid", senderid));
        qparams.add(new BasicNameValuePair("to", to));
        qparams.add(new BasicNameValuePair("text", text));
        qparams.add(new BasicNameValuePair("type", type));
        qparams.add(new BasicNameValuePair("datetime", datetime));
        URI uri = URIUtils.createURI("http", ppgHost, -1, path, URLEncodedUtils.format(qparams, "UTF-8"), null);
        HttpPost httppost = new HttpPost(uri);
        System.out.println(httppost.getURI());
        HttpResponse response = httpClient.execute(httppost);
        System.out.println(response.getStatusLine());    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:14:05+00:00Added an answer on June 4, 2026 at 3:14 am

    If it’s a URL you can use the percent-encoded value for a new line, it’s %0D%0A although %0A (ASCII 10 – line feed) or %0D (ASCII 13 – carriage return) should work alone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to read SMS messages from Inbox,Draft,and sent from my blackberry device programmatically.
I want to write method to send SMS on number and with text from
I want to sent the data from an Android device to PHP. I have
I want to track the number of messages that are sent from an android
I am working on application. I want to send sms to number directly by
I want to develop a sms application which send automatic sms to the sms
I'm creating a CMS, and want all request sent to Default.aspx except for the
I want to shrink the data that is sent back and forth via AJAX,
I want to have my pdf files sent this way to my users :
I want to see the actual commands sent to g++ during a Code::Blocks build.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.