• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Sending Email Error??????  RSS feed

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I'm trying to send email,I'm getting error says :"connection refused :no further information ".
what do i need? really i'm new to the whole idea.
I'm sure i'm supplying wrong arguments to from() and to() methods.
please take a look at my code and correct the argument.
thanks alot for your time.
import java.io.*;
import sun.net.smtp.SmtpClient;
import java.net.InetAddress;
import java.util.*;
public class senEmail
{
public static void main(String arg[])
{
PrintStream outMail;
SmtpClient sendmail;
try
{
sendmail = new SmtpClient("www.yahoo.com");
sendmail.from("mohseif@yahoo.com");
sendmail.to("bay68@yahoo.com");
outMail = sendmail.startMessage();
outMail.println("from :tester");
outMail.flush();
outMail.close();
sendmail.closeServer();
}
catch(Exception e)
{
//System.out.println(e.printSatckTrace());
System.out.println(e.getMessage());
}
}
}
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will work for you!

Thanks!
Roseanne
Join our SCJD Study Group when certified
[This message has been edited by Roseanne Zhang (edited September 08, 2001).]
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed the link of SCJD group.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!