i hope you can help me because i am new in network programming.
I am trying to send email from j2me to googlemail account I have 2 classes EmailMidlet (which has been tested with wireless Toolkit 2.5.2 and it works) and the second class is the servlet-class named EmailServlet:
when i call the EmailServlet, i get on the console: Server: 220 mx.google.com ESMTP g28sm19313024fkg.21 Server: 250 mx.google.com at your service
this is the code of my EmailServlet
1.when i print "to" in EmailServlet also:
it show null on the console 2. ist this right in case of googlemail.com?
and this is my EmailMidlet:
I would be very grateful if somebody can help me.
ujjwal soni
Ranch Hand
Joined: Mar 28, 2007
Posts: 391
posted
0
Hi,
Check with your firewall settings, you can add an exception to port 25 there.
To do this, go to run -> type firewall.cpl -> press enter
Cheers!!!
Ujjwal B Soni
Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
luck, db
There are no new questions, but there may be new answers.
sumanta panda
Ranch Hand
Joined: Jun 23, 2008
Posts: 224
posted
0
[Edit: thread hijack removed. Ask your own questions in your own topics, and be sure to post them in an appropriate forum.] [ December 26, 2008: Message edited by: Bear Bibeault ]
Muhammed Salah
Greenhorn
Joined: Dec 25, 2008
Posts: 8
posted
0
thank you all for replay.
@ujjwal soni
i did the following: exception: Name:SMTP (name correct?) PortNr: 25
nothing change
i have notice the follwing warning for the method readline() in EmailServlet: the method readline from the typ DataInputStream is deprecated.
could it be a problem?
Muhammed Salah
Greenhorn
Joined: Dec 25, 2008
Posts: 8
posted
0
I have one quistion about transfering data between midlet-class servlet-class through DataInputStream and DataOutPutStream.
i write the following in the midlet-class: DataOutputStream os = c.openDataOutputStream(); os.write(("to="+to).getBytes()); (where String to="myemail@googlemail.com"; ) os.write(("&subject="+subject).getBytes()); ..... ....
and tried to call this in the servlet-class through the following: request.getParameter("to");
Originally posted by Muhammed Salah: request.getParameter("to");
it returns null
That just means there wasn't any "to" parameter in the request. Nothing to do with e-mail or DataInputStream or any of those things, the user just didn't type anything into the "to" field.
Originally posted by Bear Bibeault: A null indicates that the text field was not part of the submitted form to begin with.
And it appears that the posted code with DataOutputStreams is trying to do something like submitting a form. It looks like it's generating a "to" parameter, but the comments indicate the value of that parameter is something which should be URL-encoded, but isn't. And who knows? Maybe that's the wrong place to put the parameter. It's hard to tell from that fragment of code.
java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.io.DataInputStream.readLine(Unknown Source) at EmailSender.send(EmailSender.java:59) at EmailSender.main(EmailSender.java:79)
i was researching about this error in google some people say firewall could be the problem. i shut down my firewall and antivirus but nothing change.
any idea, what can i do?
thank you
Muhammed Salah
Greenhorn
Joined: Dec 25, 2008
Posts: 8
posted
0
I have solved my Problem by using java mail.
I would like to thank everyone here, who tried to help me.........
Thank you so much, thedaystar
firstName SecondName
Greenhorn
Joined: Mar 20, 2009
Posts: 15
posted
0
Muhammed Salah wrote:I have solved my Problem by using java mail.
I would like to thank everyone here, who tried to help me.........
Thank you so much, thedaystar
hi brother,
i saw your post regarding email sending from j2me.
can you please email me or paste here your running code of email sending .
Your help will be highly appreciable!
ahsan
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
He said that he solved it using JavaMail.
Here is its homepage: http://java.sun.com/products/javamail Especially checkout the FAQ, it contains lot of information and code examples.
Bauke Scholtz wrote:He said that he solved it using JavaMail.
Here is its homepage: http://java.sun.com/products/javamail Especially checkout the FAQ, it contains lot of information and code examples.
hi,
how can i use this javamail .
do you have any suggestions.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
As said, especially checkout the FAQ, it contains lot of information and code examples. You can find a link to the FAQ in the left navigatio menu.
It is not that hard. Just create a Java class which does the mailing task independently and test it as a Java application using main(). Once you got that work, just import/use that class in your J2ME application.
firstName SecondName
Greenhorn
Joined: Mar 20, 2009
Posts: 15
posted
0
Bauke Scholtz wrote:As said, especially checkout the FAQ, it contains lot of information and code examples.
It is not that hard. Just create a Java class which does the mailing task independently and test it as a Java application using main(). Once you got that work, just import/use that class in your J2ME application.