Results 1 to 5 of 5
Thread: How to send sms using java
- 01-25-2011, 05:54 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 33
- Rep Power
- 0
How to send sms using java
i have done the following codes:
public class Sms {
public Sms() {
}
public void msgsend() {
String username = "guoxiang";
String password = "*******";
String smtphost = "ipipi.com";
String compression = "on";
String from = "guoxiang@gmail.com";
String to = "92706121";
String body = "Hello SMS World!";
Transport myTransport = null;
try {
Properties props = System.getProperties();
props.put("mail.smtp.auth", "true");
Session mailSession = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(mailSession);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(compression);
msg.setText(body);
msg.setSentDate(new Date());
myTransport = mailSession.getTransport("smtp");
myTransport.connect(smtphost, username, password);
msg.saveChanges();
myTransport.sendMessage(msg, msg.getAllRecipients());
myTransport.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] argv) {
Sms smtpSend = new Sms();
smtpSend.msgsend();
}
}
i got the error
javax.mail.AuthenticationFailedException: 535 Authentication Failed
at com.sun.mail.smtp.SMTPTransport$Authenticator.auth enticate(SMTPTransport.java:648)
please help me
- 01-25-2011, 07:26 PM #2
Really? Why? So that you can run away in between and waste our efforts?
If I remember correctly, you were the same user who asked for help while sending mail using Java. Here is the link for that thread: Using Java Send Email
Did you implement what I told you there?
I don't think so. You simply neglected that and moved away, which made me feel like an Idiot, who wasted my time trying to help you out.
Now, you have come across the same issue and you are seeking for help again. Why I or even anyone else here should help you out? What's the point if you are not going to listen to us?
If you are going to skip or run away from your problems now, somewhere down the line you will face them again. What will you do then?
Now, the solution to your current problem is the same thing which was advised to you in your previous thread. What will you do now?
GoldestJava Is A Funny Language... Really!.gif)
Click on * and add to member reputation, if you find their advices/solutions effective.
- 01-26-2011, 06:59 AM #3
Member
- Join Date
- Nov 2010
- Posts
- 33
- Rep Power
- 0
i didnt run away from the prev problem, i solved it thanks to you. i remembered.nvm then i try it myself. thanks for the advice.
- 01-27-2011, 08:23 PM #4
If thats the case, you need to thank the contributors and close the thread.i didnt run away from the prev problem, i solved it thanks to you.
- 01-29-2011, 04:27 AM #5
Member
- Join Date
- Nov 2010
- Posts
- 33
- Rep Power
- 0
Similar Threads
-
simple send email APP, but when press send button appeared:
By lse123 in forum Advanced JavaReplies: 10Last Post: 06-06-2010, 06:49 PM -
How to send a java file?
By Drareeg in forum New To JavaReplies: 7Last Post: 05-10-2010, 09:29 PM -
how to send SMS using Java API
By sanjeevtarar in forum Advanced JavaReplies: 4Last Post: 09-13-2009, 03:15 PM -
How to send SMS using JAVA
By sivaskgr in forum New To JavaReplies: 0Last Post: 03-18-2009, 01:37 PM -
Send a pic through mail, in java
By lenny in forum Advanced JavaReplies: 1Last Post: 07-25-2007, 02:49 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks