451 SMTP-MAIL: died on signal 11

Hi friends

I see lots of others have had problems with mail, but I have searched for this error without finding anything so hope someone can help me.

I have a smtp mail from the JavaGuru examples which works fine when sending an email with sender and recipient on the same unix server, but when the recipient is on a different server I get the messages:

SENT: RCPT TO:<address@hotmail.com>

RCVD: 451 SMTP-MAIL: died on signal 11

Transport: Sending failed because of invalid destination addresses

The destination address is ok as I have tested with the unix mailx command and can successfully send to the recipient on a different server, so I'm stuck - I would be pleased to get any suggestions on what the problem might be.

Thanks, Paul.

[801 byte] By [smart28p] at [2007-9-26 8:40:13]
# 1
Hi Paul:How do you config your smtp transport ?The error message show that smtp server doesn't know the destination address.
netgo at 2007-7-1 19:27:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi, thanks for your time. Here's my code:

import java.util.Properties;

import javax.mail.*;

import javax.mail.internet.*;

import javax.activation.*;

public class AttachExample {

public static void main (String args[]) throws Exception {

String host = args[0];

String from = args[1];

String to = args[2];

String filename = args[3];

String username = args[4];

String password = args[5];

PasswordAuthentication pwa = new PasswordAuthentication(username,password);

URLName urlname = new URLName("smtp", host, -1, "dummy", username, password);

// Get system properties

Properties props = System.getProperties();

// Setup mail server

props.put("mail.smtp.host", host);

// Get session

Session session = Session.getInstance(props, null);

session.setDebug(true);

session.setPasswordAuthentication(urlname, pwa);

// Define message

Message message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

message.addRecipient(Message.RecipientType.TO,

new InternetAddress(to));

message.setSubject("Hello JavaMail Attachment");

// Create the message part

BodyPart messageBodyPart = new MimeBodyPart();

// Fill the message

messageBodyPart.setText("Here's the file");

// Create a Multipart

Multipart multipart = new MimeMultipart();

// Add part one

multipart.addBodyPart(messageBodyPart);

//

// Part two is attachment

//

// Create second body part

messageBodyPart = new MimeBodyPart();

// Get the attachment

DataSource source = new FileDataSource(filename);

// Set the data handler to the attachment

messageBodyPart.setDataHandler(new DataHandler(source));

// Set the filename

messageBodyPart.setFileName(filename);

// Add part two

multipart.addBodyPart(messageBodyPart);

// Put parts in message

message.setContent(multipart);

message.saveChanges();

// Send the message

Transport.send(message);

}

}

Any suggestions would be very welcome. Have I missed something obvious? (I'm new to Java).

smart28p at 2007-7-1 19:27:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
problem solved, thanks netgoI had set the variable host=local server nameI have now set host=local server name.global nameand it works!Paul.
smart28p at 2007-7-1 19:27:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...