aspose file tools*
The moose likes Java Micro Edition and the fly likes Any one can help me to find out problem to send SMS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Any one can help me to find out problem to send SMS?" Watch "Any one can help me to find out problem to send SMS?" New topic
Author

Any one can help me to find out problem to send SMS?

Yatin Shah
Ranch Hand

Joined: Sep 11, 2004
Posts: 72
Hello Sir,

Please, check my following code is it correct or not? Because, I can received E-mail But I am not getting message on Mobile.

//package com.psol.xslist;

import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;

public class SendMessage
{
public static final void main(String[] args)
{
try
{
Properties props = System.getProperties();
props.put("mail.smtp.host","172.24.11.19");
Session session = Session.getDefaultInstance(props);
Message message = new MimeMessage(session);
InternetAddress from = new InternetAddress("administrator@msubaroda.ac.in");
InternetAddress to[] = InternetAddress.parse("yatin_39@hotmail.com,9825343210@west.hutch.co.in");
message.setFrom(from);
message.setRecipients(Message.RecipientType.TO,to);
message.setSubject("Server Information");
message.setSentDate(new Date());
message.setText("Server is working.");
Transport.send(message);
}
catch(MessagingException e)
{
System.err.println(e.getMessage());
}
}
}

Thanking You
Yatin
Ashish Chopra
Ranch Hand

Joined: Nov 30, 2004
Posts: 134
hi yatin...

have u tried sending an e-mail to :"9825343210@west.hutch.co.in"(your number i guess) and checked if u receive an sms with the same contents? check if that works first...

there may be 2 problems:
a) The service provider doesn't support such a service.
b) The format of sms may not be MIME formats.

maybe u can check this out and post it so we can think more on this one....


Quis Custodiet Ipsos Custodes<br /> <br />My blog: <a href="http://www.coherentrambling.blogspot.com" target="_blank" rel="nofollow">http://www.coherentrambling.blogspot.com</a>
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

I'm moving this to the J2ME forum where SMS is talked about more often.

So please post your replies there. Thanks!
Yatin Shah
Ranch Hand

Joined: Sep 11, 2004
Posts: 72
Hi,

Yes I tried No. of times but I am not getting SMS. It shows Message has been sent. By chance, If you have some other method to do. Please, let me know. I am staying in Gujarat, India. Is there any special address to send SMS? Please, let me know.

Thanking You
Yatin
[ December 10, 2004: Message edited by: Yatin Shah ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any one can help me to find out problem to send SMS?
 
Similar Threads
Please, help me in SMS code.
SendFailedException for sending simple email by using JavaMail
javax.mail problem with "cc" option.
Java Mail Authentication
how to send a mail to yahoo user