• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

email code in j2me application

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the servlet code for send email from j2me application?
When I run the j2me user interface for this code, it shows me the println() given in the code, but email is not sent to the specific account.
Kindly check this code and tell me if something is wrong.\
Code marked in red Moderator: commented with the word RED - need an email address and ip address of the smtp server.


 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know about servlets. That's from Java EE. This may be the wrong section of the Java Ranch Message Boards to ask about server-side programming.

You can't run a servlet inside of Java ME because the classes, like java.net.*, don't exist in Java ME. The only resources you can find here, in this section of forum, is the types of connections that Java ME can make. But you also need a pop/smtp email server to connect to that actually sends the message and for that you need some advice from people who know java server or other types of servers.

Java ME just has the following packages:
java.io
javax.microedition.io

Plus whatever networking packages ship in MSA (jsr 248)...
JSR 82 Bluetooth,
205 Wireless Messaging,
172 Web Services,
180 SIP
-- maybe one of them has a network connection you can use??

Plus the brand-specific custom API extensions that cell phone makers (such a Nokia) include in their phones.
 
Priyanka Gawada
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
I got the code from the following site: http://developers.sun.com/mobility/midp/articles/socketRMI/
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, so yes. Java ME can open a connection. The article you post says that you need somthing to pick up the connection, a Servlet perhaps (see Servlets forum for validation of the Servlet and latest standards) and, that's not all, you also need a web host or server -- A web host that supports Java EE/Servlets if you choose the Servlet option.


I have seen people ask about server-side scripting before, but I don't know enough about the server side of things to actually point people at the solution. Supposedly you wouldn't even need a servlet just something, anything, just so long as it can answer a connection call then act on it which means you might have better luck on one of the dedicated forms for one of the Server-side languages. (Some server-side scripts are more supported than others, PHP is a popular one for example.)

As Wikipedia says:

Some server-side scripting languages:

ASP (*.asp, *.aspx)
C via CGI (*.c, *.csp)
ColdFusion Markup Language (*.cfm)
Java via JavaServer Pages (*.jsp)
JavaScript using Server-side JavaScript (*.ssjs, *.js)
Lua (*.lp *.op)
Perl CGI (*.cgi, *.ipl, *.pl)
PHP (*.php)
Python via Django (*.py)
Ruby, e.g. Ruby on Rails (*.rb, *.rbw)
SMX (*.smx)
Lasso (*.lasso)
WebDNA (*.dna,*.tpl)
Progress WebSpeed (*.r,*.w)

 
Walter Gabrielsen Iii
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh apparently Nokia has an article including a reference to Mail4Me, see: Sending mail from applications in Java ME.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic