Send an SMS from my application

Hi all

I want to send a TEXT from my application. I don't want to use the composer using the calling method. If I want to send an SMS via my interface customized, without using the invocation of course. How can I do?

I think that you need.

void ApplicationUI::sendSMS (QString QString messageText, phoneNumber) {}
If (phoneNumber.length () == 0) {}
logToConsole ("Blank is invalid phone number");
return;
}
BB:im::account:AccountService accountService;
QList accountList = accountService.accounts (Service::Messages, "sms - mms");

BB:im::account:AccountKey smsAccountId = 0;
If (! accountList.isEmpty ()) {}
smsAccountId = accountList.first (user.user ());
qDebug()< "sms-mms="" account="" id:"=""><>
}
else {}
qWarning()< "could="" not="" find="" sms="">
return;
}

BB:im::message:MessageService messageService;
QList in which they participate;
BB:im::message:MessageContact recipient = bb:im::message:MessageContact(-1,_bb:___im::message::MessageContact::To,_phoneNumber,_phoneNumber).
participants. Append (container);

BB:im::message:ConversationBuilder * conversationBuilder = bb:im::message::ConversationBuilder::create();
conversationBuilder-> accountId (smsAccountId);
conversationBuilder-> participants (participants);

BB:conversation = im::message:Conversation * conversationBuilder;
BB:im::message:ConversationKey conversationId = messageService.save (smsAccountId, conversation);

BB:im::message:MessageBuilder * generator = bb:im::message:MessageBuilder:create (smsAccountId);
generator-> conversationId (conversationId);

generator-> addAttachment (bb:im::message:Attachment ("text/plain", "", messageText.toUtf8 ()));

foreach (const bb:im::message:MessageContact beneficiaries, participants)
{
generator-> addRecipient (container);
}

BB:im::message:Message message = * manufacturer;

messageService.send (smsAccountId, message);

Delete the constructor;
delete conversationBuilder;

}

Tags: BlackBerry Developers

Similar Questions

  • How do I send the email from the Application Web ADF

    Hello

    JDeveloper Version: 11.1.1.5.0

    I develop an ADF Web Application that contains the user interface pages developed using JSF. I provide a two or three page button which, when clicked will be posting current pdf page content or documents to a mail id.
    I run my Web ADF Application on Weblogic Server built-in by default.

    For the mail merge feature, I try the following code in my grain of support:


    public String mail() {}
    Add the code in the event here...
    Identification of the recipient should be mentioned.
    String to = "[email protected]";

    Email of the sender identification should be mentioned
    String from = "[email protected]";

    Assuming that you send e-mail from localhost
    String host = "localhost";

    Get system properties
    Properties properties = System.getProperties ();

    The mail Server Setup
    properties.setProperty ("mail.smtp.host", host);

    try {}
    Retrieve the default Session object.
    Session;
    session = (Session) Session.getDefaultInstance (properties, null);
    Create a default MimeMessage object.
    MimeMessage message = new MimeMessage (session);

    Set of: header field in the header.
    message.setFrom (new InternetAddress (from));

    Value: header field in the header.
    message.addRecipient (Message.RecipientType.TO,
    new InternetAddress (to));

    Set object: header field
    message.setSubject ("this is the subject line!");

    Now define the message itself
    message.setText ("this is a real message");

    Send message
    Transport t = session.getTransport ("smtp");
    t.Connect ();
    Address toAddr = new InternetAddress [] [1];
    toAddr [0] = new InternetAddress (to);
    t.sendMessage (message, toAddr);
    t.Close ();
    Transport.Send (message);
    System.out.println ("sent message successfully...");
    } catch (MessagingException mex) {}
    mex.printStackTrace ();
    }

    Returns a null value.
    }

    Note: [email protected] is replaced by gmail valid id in real code.

    When I try to call the method mail() above since the command button in my page, it is to launch the exception below:


    javax.mail.MessagingException: Exception reading response;
    nested exception is:
    java.net.SocketException: connection reset
    at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
    at javax.mail.Service.connect(Service.java:288)
    at javax.mail.Service.connect(Service.java:169)
    at javax.mail.Service.connect(Service.java:118)
    at xxxxxxxxx.ui.SendMail.mail(SendMail.java:102)


    Please let me know if the code position of java at the above address is fine or if I make changes in my WebLogic Server to allow installation of electronic mail

    I use Apache Commons email (http://commons.apache.org/email/) to make something similar. It is easy and comes with samples, and it works!

    Timo

  • How to block the sending of SMS from BlackBerry in the code

    I tried to use notifyOutgoingMessage to interface OutboundMessageListener to catch the sending of SMS, but it does not work. In the document, I only give a copy of the message. So, I wonder how can I get SMS messages and block in the code? This is my essay:

    MessageConnection _mc = (MessageConnection) Connector.open("sms://:0");
    _mc.setMessageListener(new OutboundSMSListener());
    
    private static final class OutboundSMSListener implements OutboundMessageListener
    {
    public void notifyIncomingMessage(MessageConnection messageconnection)
    {
    
    System.out.println("Income Message received: ");
    }
    
    public void notifyOutgoingMessage(Message message)
    {
    
    System.out.println("------------------------\n\n\n\n\n");
    System.out.println("Message send: " + message);
    }
    }
    

    Implement SMS.addSendListener () and returns the value false in the sendMessage method. BTW, the SMS class has been implemented in 4.6.0 is not possible to do it on an OS earlier.

  • How can I send a text from my application?

    Hi, I want to send an sms and email my aplication, could someone show me how I can do? Thank you

    Thank you!

  • How to send an SMS from the command prompt in Windows 7?

    I clicked on this link http://www.fomine.com/net-send-gui.html in reference to the same question that I have.  It says nothing about the ability to use in Windows 7.  What I try to do is to send a message to a computer (Windows XP) and an iPod on my network to a batch file on my laptop using Windows 7.  I have a simple batch file with this tag to the breast:

    CLS

    the value n/p = planned ip address

    the value m/p = Hello this is a test
    net send /%n% /%m%

    BREAK

    All feel that it worked.  But when I look at the pc (Windows XP) through the room, it is not a pop-up message.  Someone at - it a sugguestions?

    I clicked on this link http://www.fomine.com/net-send-gui.html in reference to the same question that I have.  It says nothing about the ability to use in Windows 7.  What I try to do is to send a message to a computer (Windows XP) and an iPod on my network to a batch file on my laptop using Windows 7.  I have a simple batch file with this tag to the breast:

    CLS

    the value n/p = planned ip address

    the value m/p = Hello this is a test
    net send /%n% /%m%

    BREAK

    All feel that it worked.  But when I look at the pc (Windows XP) through the room, it is not a pop-up message.  Someone at - it a sugguestions?

    It's all about existing communication from the computer to the other.

    NET SEND no longer exists in WIndows 7, if I remember correctly, it's the MSG, I think.

    Also - I think by default, that "Messenger" service has been disabled after SP2 for Windows XP.  You will need to change that to start automatic/enabled.

    Furthermore, I believe that you would have to modify the Windows Firewall to allow this traffic.

  • How to send an email from BB10 application?

    https://developer.BlackBerry.com/native/documentation/Cascades/device_platform/PIM/messages.html

    This article describes the code as examples:

    I realized that I had not checked the sample applications, and it is in fact an example of application 'messages' that seems to work.

  • How to send SMS from a web application to for free?

    In my view, what API JavaMail will help send emails and SMS Messages via the SMTP server. I want to know how it actually works and how to configure the SMTP server? How to send SMS from java program? Is there any material available on the web? Please give some input.
    Thanks in advance.

    user12873853 wrote:
    In my view, what API JavaMail will help send emails and SMS Messages via the SMTP server.

    Looks like more false hope that belief for me. The only way that works is if you have a SMS gateway which allows communication via SMTP. No doubt some exist (search for 'JavaMail sms' through google seems to indicate), but if you have to ask you don't have.

    And who exactly where you are stuck: to send SMS messages, you need an SMS gateway. It will be the first thing that you have store because, so far, there is no reason to think in code, protocols or implementations. It can be as simple as plugging a mobile phone, but then you can send messages in mass of course. Most likely, you will need to shop for a partner who has a SMS service you can use blasting.

  • Sending SMS from the Defy: two questions

    I've been with the Defy for a few weeks and I love the phone, but with all the power of Android, I lack some features, that I used to have in my old classic 'Hynek '. Perhaps they are there and I just have not found, but believe me, I really look...

    Two of them are currently particularly annoying when sending SMS. Here in Brazil, the long distance dialing format includes a code of long distance provider of your choice (specifically, you must dial 0 + code of the carrier + area code + phone number). So, I added all the entries on my directory, including the carrier code which usually has the lowest rates. But this format does not work to send text messages. to do this, use + 55 (the Brazil country code) + area code + phone number. There are a couple of other formats that the carrier has properly analysis and sends the message (for example, to send messages to phones in the same area code, just without any codes work phone number), but the format used for long distance calls cannot be used.

    My old phone had a feature that allows you to modify the number before sending the message, and I used that. With the Defy, I'll have to look up the number in the phone book and type it in the appropriate format, rather than choose the contact directly here as a destination. Is there a way to change the number before sending on the Defy? I tried, but it only allows me to delete this contact or include another. I also thought to including an additional entry phone just for SMS for each contact in the phone book, but it would be too complicated.

    The second feature is the ability to set the phone to send a request for confirmation of delivery as well as the message. As soon as the message was delivered to the recipient's phone, I got a message of confirmation by the carrier. While most of the messages are provided instantly, some, especially to another carrier, or if the recipient's phone is turned off or out of coverage in time, may take longer and sometimes it is important to know if the other person actually received it. My Defy not to do and I couldn't find any configuration option to allow this. I'm on the same carrier as before, so the feature support is not a problem.

    So, anyone know of a way to change the phone number before sending an SMS and request a delivery confirmation message?

    Thank you very much.

    Thank you, j0h4n. In the end, I solved both problems by simply using a different application. What I've explored, there doesn't seem to be a way to change the phone number of the addressee on the fly with the standard application, and everything by asking a delivery report is possible, he is not required by default, may not be configured to be requested by default and must be done individually for each message sent.

    But I explored the Android Market, try Handcent SMS and SMS GO and found both to be excellent. Both allow changing the number on the fly and NDRs that would be asked by default (in addition to many other interesting features). Since they have interfered with each other, I had to choose an and kept GOING SMS, I found a bit niftier to use and implemented the number editing best feature (Handcent editor a bit confused with this and I had to be careful when editing).

    Obviously, English isn't a problem for me, if not Handcent would have the head, because it is available, located in Portuguese (and many other languages), while SMS GO is only available in English and Chinese. But as it is, I liked it. I would still recommend Handcent and users should try both to see which they like best.

  • Sending of text message (SMS) from Outlook 2010 to HP Slate 6 VoiceTab

    Hello

    I have a HP Slate 6 voice tab.  I tried to send TEXT messages from Outlook 2010 to my HP Slate 6 voice tab (and to other numbers) without any success...  Is is due to the fact that I don't have the option to select "Sync SMS" in my email account Corp on my Tablet?   All I have is sync Email, Contacts & Calendar - No. SMS.

    The Android version on my tablet is: 4.2.2.

    Thanks for your response!

    I work for HP

    Hi Questions_HP, welcome to the Forums of HP. I understand that you are unable to receive SMS messages sent by Outlook 2010. It seems that you have to either have an Exchange Server or 3rd Party SMS service involved for this to work. Beyond that, I don't know what requirements must be met to do this, the only information I found on the topic was this document: send and receive text messages (SMS)

    You may have more luck finding information in the forums focused on Outlook. Post a solution if you find one.

  • Send sms from background thread

    Hey I am trying to send sms from a background thread

    I searched the forum and tried a lot of code, but without success.

    anybode help me what m I am doing wrong

    try
    {
    MessageConnection msgConn = (MessageConnection) Connector.open("sms://+"+ "965xxxxxxx");
    TextMessage text = (TextMessage) msgConn.newMessage(MessageConnection.TEXT_MESSAGE);
    text.setPayloadText("helloooooo");
    msgConn.send(text);
    msgConn.close();    
    
            }catch(Exception e)
            {
                System.out.println("exception in sending message:"+e);
            }
    

    I always get illegal argument exception if I get ahead in debug mode.

    If I test on the device then java.lang.error exception is thrown

    I also tried with an address like + 91965xxxxxxx but still the same error

    I also tried with an address like 0965xxxxxxx, but still the same error

    Sometimes it gets hang up

    I have also worked with port don't

    try
    {
      MessageConnection sconn =  (MessageConnection)Connector.open("sms://:3333");
    TextMessage msg = (TextMessage) sconn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setAddress("sms://+965xxxxxxx:3333");
    msg.setPayloadText( "Hello World" );
    sconn.send(msg);
    }catch(Exception e)
    {
    }
    

    If anyone can help!

    I got the answer:

    MessageConnection  mc = (MessageConnection) Connector.open("sms://"+address);
    m = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE);
    m.setPayloadText(msg);
    mc.send(m);
    

    I wrote all the code in a thread separate and calls of my background thread

  • What are the details of sending messages text/SMS from computer?

    I'm afraid that this question is a bit off topic, but I searched and searched and searched for information on how to send any text or SMS from my computer. I don't have a cell phone, but I am inclined to believe that I can send the text of my computer. I am particularly interested in sending text responses in places like surveys of Ed Schultz Show text. I do not understand how to address a message to send text. The Ed Schultz Show refers to a number ": 6222639", and an address "* address email is removed from the privacy *, then apply to the text an 'A' or a 'B'." I'm just confused. Please, someone give me a clue.

    Thank you in advance to give a useful answer and not a bad mood put down.

    You need a cellular service to send text messages,

    Your internet service provider is perhaps the best people to ask,

    Instant messages, SMS is a function of a Messenger service,

    Hotmail - outlook.com uses Skype,

    Gmail has its own technology,

    What email service do you use, yahoo...

  • What Contacts are used when send the email from the Mail application?

    I have a sky email Yahoo where all my contacts are available.     I use the people App where my contacts are available.   When I want to send an email using the Mail (which is related to my emails from sky) application, then all my contacts don't EXIST - why.

    Will you please explain in simple language please because I'm not technical interest

    OT: Contacts

    Hello

    I suggest you try the steps from the following link to import the Sky email account contacts.

    Add, import and export of contacts
    http://help.sky.com/email/managing-your-contacts/adding-importing-and-exporting-contacts

    To further support on behalf of heaven, I suggest you show in sky support forums.
    http://helpforum.sky.com/T5/sky-Yahoo-mail/BD-p/emailsandtools

    I hope this helps.

  • Companies in the country of residence, said Apple devices can send sms from one country to another unless the owner knows. If it's true there at - it an explanation why and how to stop this shit.

    Recently, in Albania, I have an mobile number, and normally they have offers and their packages on calls and sms. the sticky thing is they also have the option to go short of the amount you paid. But that's only if you activate and I know that you can go out, even if it's a prepaid number, strange o my eyes and strange i just that apple can send sms to the United Kingdom without I know and this power use iPhone like at the beginning, but never seen anything like this.  Mainly I mind because of confidence in the company and the product, not because it s a small amount of monye, but because I have no idea and I'm checking all my sms with this strange issue that i don't know who he is.

    How ever I'd like to know can´t it possible to a iPhone can send sms without I know number that I have no idea as I have registered it in my cell phone. So what to do, before I report it to the authority and the Police because it seems like a fraud. And I don't want to pay for something I've ever used.

    If your device sends an SMS to the United Kingdom, it seems that you are referring to the SMS activation for iMessage and FaceTime. It is a text Message hidden so check with the Apple server to the United Kingdom. If you are using media supported for the iPhone, they normally do not charge for these SMS, so I think that you are not using a supported carrier. If you have tried to enable iMessage and/or FaceTime, which is the cause. You should contact your operator to find out if they support iMessage and FaceTime. If this isn't the case, then you can not use these features.

  • How to automatically send an sms to the team?

    I would like to know if there is a way (setting) or an application that can automatically send an sms (txt) to my team?

    A 3rd party app called IFFT may enforce an assortment of things, among them actions based on SMS.

    For some recipes, as they call it, take a look on their website: https://ifttt.com/sms

  • I unsubscribed from my application only one then it refunded, but how long does take to get to my accounan for me to get my money back

    I bought a computer application don't work well one I unsubscribed from my application one then it refunded, but how long does take to get to my accounan for me to get my money, I have looking for Bowen but I Don t have the refund back on my account

    < re-titled by host >

    Normally apple support sends you an email when a purchase is refunded. Most of the time it will hit your account within 72 hours.

Maybe you are looking for