Connecting Mail

First of all, am I in the correct forum. The code is below, it may be way off the mark, but I think it's another problem:

at the bottom of the code, I put my e-mail address in the Address object. But the exception I get is:

Exception in thread "main" com.sun.mail.smtp.SMTPSendFailedException: 550 Invalid recipient: michael_heeneman@hotmail.com

is this a simple problem to resolve? I've been warned I may not have set the protocols up properly.

public void sendMessage() throws javax.mail.MessagingException

{

Properties properties = new Properties();

properties.setProperty("protocol","smtp");

properties.setProperty("type","transport");

properties.setProperty("class","com.sun.mail.smtp.SMTPTransport");

properties.setProperty("vendor","Sun Microsystems, Inc.");

Session session = Session.getInstance(properties);

SMTPMessage message = new SMTPMessage(session);

message.setEnvelopeFrom(fromAddress);

try

{

message.setHeader("There is a forum message for you.","There

is a forum message for you.");

}

catch (javax.mail.MessagingException me)

{

me.toString();

throw me;

}

message.setText("Your local group wants you to check at the

"+fromAddress);

int numberOfAddresses = 2;

InternetAddress[] addresses = new InternetAddress

[numberOfAddresses];

for (int i = 0; i<numberOfAddresses; i++)

addresses=new InternetAddress();

addresses[0].setAddress("michael_heeneman@hotmail.com");

addresses[1].setAddress("michael_heeneman@hotmail.com");

message.setRecipients(Message.RecipientType.TO,addresses);

URLName theURLName = new URLName(urlName);

SMTPTransport transport = new SMTPTransport(session,theURLName);

transport.send(message,addresses);

}>

[1877 byte] By [burntcandlea] at [2007-11-27 7:02:34]
# 1

Obviously the code you included is not the code you're actually running,

since the code you included won't even compile.

Still, based on the exception you're getting it's clear that you're actually

talking to your mail server, but your mail server is rejecting the address

you specified. I can't see any obvious reason for it to do so. Perhaps

you'll find more information in the entire protocol trace. (See the JavaMail

FAQ.) Possibly you're running into the "relay" problem described in the

FAQ, even though the error message from the server doesn't say so.

bshannona at 2007-7-12 18:53:37 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...