Send a text message by email using sms from your j2me phone

I am developing a j2me application and I was wondering if anyone knows how to send an sms message to an email address. I need to use sms as I try to send data through it using an unlimited text plan instead of an unlimited data plan.

I changed the sample code from http://freecode-freecode.blogspot.com/2008/06/how-to-send-sms-in-j2me.html , but I can not send an email. The corresponding code is as follows:

  MessageConnection smsCon= (MessageConnection) Connector.open("sms://email@emailprovider.com:25");
  TextMessage txtmessage = (TextMessage) smsCon.newMessage(MessageConnection.TEXT_MESSAGE);
  txtmessage.setAddress("sms://email@emailprovider.com:25");// !!
  txtmessage.setPayloadText("Hello from j2me sms api");
  smsconn.send(txtmessage);

but it does not work. I have no idea how to approach this. I sent a text message manually by phone, created in a text message, by email, but I can not do this in code.

+3
source share
3 answers

Any handset that supports JSR 205 should be able to do this in approximately the following way (not compiled or verified !!):

 MessageConnection emailCon = (MessageConnection) Connector.open("mms://email@emailprovider.com");
 MultipartMessage email = (MultipartMessage) emailCon.newMessage(MessageConnection.MULTIPART_MESSAGE);
 email.setSubject("Hello from j2me WMA 2.0 api");
 // add some MessageParts in here...
 emailCon.send(email);

The specification for the MMS URL indicates that the email address is a valid MMS address.

+3
source

You cannot send e-mail in the form of SMS messages if you do not have special support in the organization receiving the SMS message or in the SMS Service Center.

, / SMS. SMS , (*, #, ). SMS- , 10 ...

/ , , SMS-to-email, .

: : http://www.visualtron.com/sms2email.htm

SMS-to-mail J2me, . SMS- , MIDlet-. SMTP HTTP-. , , .

, JSR-120 JSR-205 ( JSR-) SMS MMS-, . , , . , MMS , / MMS . "email://", .

+1

I do not think it is available with the current WMA specification. if you want to create such a service, I suggest you create an SMS gateway that received SMS, in combination with the J2SE / J2EE application that connects to the Internet. The SMS gateway analyzes the sms content for the email address, sends the J2SE / J2EE application, and this application creates the email based on the parameter that contains the email address and the rest of the sms content.

0
source

Source: https://habr.com/ru/post/1730818/


All Articles