Results 1 to 2 of 2
- 02-06-2009, 01:42 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 2
- Rep Power
- 0
[SOLVED] JavaMail Authentication Problem
Brand new to the JavaMail API. Using the following code to try and send a message from my Java desktop application:
String protocol = "smtp";
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.*****.***");
props.put("mail.from", "*********@u.washington.edu");
props.put("mail." + protocol + ".auth", "true");
Session session = Session.getInstance(props, null);
try
{ MimeMessage msg = new MimeMessage(session);
msg.setFrom();
msg.setRecipients(Message.RecipientType.TO, "********@hotmail.com");
msg.setSubject("a test");
msg.setSentDate(new Date());
msg.setText("a test message\n");
Transport t = session.getTransport(protocol);
try
{ t.connect("*******", "*********");
t.sendMessage(msg, msg.getAllRecipients());
} finally { t.close(); }
} catch (MessagingException mex) { System.out.println("send failed, exception: " + mex); }
The usernames and passwords have been replaced with the ****. This question has probably been asked before but I cannot find a thread with search. The error i get is:
send failed, exception: javax.mail.SendFailedException: Invalid Addresses;
nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Relaying denied. Proper authentication required.
When googling for a solution I find many having similar problems except that the error code they get is 550. I have tried several solutions that have worked for others but every single attempt gives me the 530. The username, password and mail server are all valid. Thanks for any suggestions.
- 02-06-2009, 05:02 PM #2
Member
- Join Date
- Dec 2008
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Javamail
By v_mallikarjun in forum Advanced JavaReplies: 14Last Post: 04-18-2008, 08:32 PM -
Using JavaMail API
By consult4u in forum NetworkingReplies: 0Last Post: 08-09-2007, 11:15 AM -
This is Regarding JSP with javamail
By venkatkomalli in forum Advanced JavaReplies: 3Last Post: 07-19-2007, 03:07 PM -
530 5.7.0 Authentication Required - JavaMail gmail
By simon in forum Advanced JavaReplies: 1Last Post: 07-15-2007, 12:52 AM -
JavaMail:Authentication required error
By bbq in forum Advanced JavaReplies: 1Last Post: 07-05-2007, 05:16 AM
Bookmarks