aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes email sendind failed (SendFailedException: 550 5.7.1 Unable to relay ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "email sendind failed (SendFailedException: 550 5.7.1 Unable to relay )" Watch "email sendind failed (SendFailedException: 550 5.7.1 Unable to relay )" New topic
Author

email sendind failed (SendFailedException: 550 5.7.1 Unable to relay )

smsiva
Greenhorn

Joined: Aug 23, 2008
Posts: 2
Execptions help to resove)
***************************
Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 Unable to relay for dhandapanism@gmail.com
******************************************************************
my codes
*******************************************
package fraternity.Mails;

import java.util.*;
import javax.activation.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.naming.*;
public class Mails
{

public String msgsend()
{

try{
InitialContext ic = new InitialContext();
Session session = (Session) ic.lookup("MyMail1");
Properties props = new Properties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.host", "localhost");
props.put("mail.from","dhandapanism@hotmail.com");
Session session2 = session.getInstance(props);
Message msg = new MimeMessage(session2);
msg.addRecipient(Message.RecipientType.TO, new InternetAddress("dhandapanism@gmail.com"));
msg.setSubject("hi");
msg.setSentDate(new Date());
MimeBodyPart mbp = new MimeBodyPart();
mbp.setText("Testing Java Mail");
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp);
msg.setContent(mp);
Transport.send(msg);

}
catch(Exception es)
{
return es.getMessage();
}
return " No error"+"message successfully send..!";
}
}
thanks
sivasm,(gobi arts)


just friendly.,<br />sivasm
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

"siva sm",

Please read your private messages regarding an important announcement.

Thank you,

Rob


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: email sendind failed (SendFailedException: 550 5.7.1 Unable to relay )