Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > problem sending mail: Sending the email to the following server failed

Reply
Thread Tools

problem sending mail: Sending the email to the following server failed

 
 
Luke
Guest
Posts: n/a
 
      03-15-2007
Hi
I use this code to send emails:

import org.apache.commons.mail.*;

SimpleEmail email = new SimpleEmail();
email.setFrom(from, "Name");
email.addTo(to);
email.setSubject(oggetto);
email.setHostName("mailserver");
email.setMsg(messaggio);
email.send();

if the "To" field is an internal address of the domain
((E-Mail Removed)) it works and the mail is sent.
If the "To" field is a domain external address ((E-Mail Removed)) it
gives me the error:
Sending the email to the following server failed : mailserver:25

How is it possibile?
any solution?

thanks

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      03-15-2007
On 15 Mar 2007 02:53:29 -0700, Luke wrote:
> if the "To" field is an internal address of the domain
> ((E-Mail Removed)) it works and the mail is sent. If the "To" field is
> a domain external address ((E-Mail Removed)) it gives me the error:
> Sending the email to the following server failed : mailserver:25


Where is the rest of the code?

What was the complete error message from the mailserver?

What happened when you turned on debugging with setDebug(true)?

Is "mailserver" the name of the outgoing SMTP server for your domain?

Do you need to authenticate with the SMTP server in order to send
outgoing mail?

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
 
Nigel Wade
Guest
Posts: n/a
 
      03-15-2007
Luke wrote:

> Hi
> I use this code to send emails:
>
> import org.apache.commons.mail.*;
>
> SimpleEmail email = new SimpleEmail();
> email.setFrom(from, "Name");
> email.addTo(to);
> email.setSubject(oggetto);
> email.setHostName("mailserver");
> email.setMsg(messaggio);
> email.send();
>
> if the "To" field is an internal address of the domain
> ((E-Mail Removed)) it works and the mail is sent.
> If the "To" field is a domain external address ((E-Mail Removed)) it
> gives me the error:
> Sending the email to the following server failed : mailserver:25
>
> How is it possibile?
> any solution?
>
> thanks


Probably because the administrator of that mail server has configured it to
prevent it being used as a relay. Are you supposed to be able to use that mail
server for relaying messages?

What it the error code and message returned?

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : http://www.velocityreviews.com/forums/(E-Mail Removed)
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Flickr] Your upload has failed with the following message: Flickr Mail Python 0 01-20-2011 08:06 AM
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
Retrieving the COM class factory for component with CLSID {F84433FF-2369-4427-B6FB-3CBA67EDA7EB} failed due to the following error: 80040154 Shailesh Patel ASP .Net 0 09-10-2007 04:27 PM
JIT Debugging failed with the following error: Access is denied. Shawn ASP .Net 10 01-01-2005 07:58 AM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:36 AM



Advertisments