Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Luke - 15 Mar 2007 10:53 GMT
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
(name@domain.it) it works and the mail is sent.
If the "To" field is a domain external address (name@yahoo.com) it
gives me the error:
Sending the email to the following server failed : mailserver:25

How is it possibile?
any solution?

thanks
Gordon Beaton - 15 Mar 2007 11:03 GMT
> if the "To" field is an internal address of the domain
> (name@domain.it) it works and the mail is sent. If the "To" field is
> a domain external address (name@yahoo.com) 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

Signature

[ 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

Nigel Wade - 15 Mar 2007 11:54 GMT
> Hi
> I use this code to send emails:
[quoted text clipped - 19 lines]
>
> 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?

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.