22858 total geeks with 3297 solutions
Recent challengers:
best bread maker
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
sefo
anilg, new comments are deleted automaticall y because of some abuse recently
anilg
this is plain wierd. I submitted comments twice to article 950, and they dont seem to be there. Something wrong with the comment code?
CodeX
shout-boxes in general are old + the staff thing happened to everyone after an issue 2 months ago
anilg
/me is no longer staff :(
anilg
Also, osix's shoutbox predated twitter. Heh.

Donate
Donate and help us fund new challenges
Donate!
Due Date: Jul 31
July Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
T-Mobile UK pumps
out the iPhone 4
Polaroid 300
instant print
camera
NatWest dumps O2
Money
YouTube ups video
time limit
Alleged expenses
fiddlers to face
justice
Nude trampolinist
bounces free from
court
Nexus One phone
rockets to 28,000ft
UK.gov drops £6m on
Google
Fake Firefox update
used to sling
scareware
Happy Sysadmin Day!
Slashdot
British ISPs Favour
Well-Connected
Customers
"Bizarre"
Nanobubbles Found
In Strained
Graphene
1-in-1,000 Chance
of Asteroid Impact
In
...
2182?
2 Chinese ISPs
Serve 20% of World
Broadband Users
World"s Fastest
Hybrid OK"d For
Production
Sometimes It"s OK
To Steal My Games
Thermoelectrics
Could Let You Feel
the Heat In Games
KDE SC 4.7 May Use
OpenGL 3 For
Compositing
Perl 6, Early, With
Rakudo Star
Internal Costs Per
Gigabyte —
What Do You Pay?
View Blog

Related Blogs


Glad to be back here in OSIX by jericocampos on Tue 16th Mar 11am

Wow! If not for the password reset, I would have forgotten my account here
in OSIX.
jericocampos's blog

Prams Buggies and Pushchairs by bb on Fri 26th Feb 9am

I've been helping out on a website people use to href="http://www.prambuggypushchair.co.uk">buy prams. Any parents out
there care to comment?
bb's blog

First one by Action on Tue 12th Jan 10pm

Yaw, this is the first blog post, just to begin with something. Nice site
here, cool features like OSIDrive, and so on. However, strange that an
"OpenSource Institute" uses non-OpenSource softare to host its
site (Windows and IIS). It's not correct... I thought, they use Linux.
Action's blog

A Daily Profanity at dailyprofanity.com by bb on Mon 21st Dec 11am

For anyone who likes viz, and roger mellies profanisaurus.

There's a website called amusing
daily profanity
which dishes up a humorous profanity every day via rss,
twitter email and a few other ways.

Rather rude words, but very funny in my opinion, although it might just be
a .uk thing!
bb's blog

Blog entry for Wed 25th Nov 7pm by hambone on Wed 25th Nov 7pm

wtf i can't do geek 12. I don't know what to do. i want to kill myself
becuz of this
hambone's blog

Blog entry for Mon 9th Nov 4am by haziman on Mon 9th Nov 4am

for all geekos out there...
haziman's blog

fuck you all!!!!!!!! by echmil on Sat 7th Nov 11pm

jag har tjock med tyngate tråkigt-.-
echmil's blog

Blog entry for Tue 5th May 6am by goldie on Tue 5th May 6am

import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import java.io.*;
import java.util.Properties;
public class SENDMAIL
{


public void sendMail(String mailServer, String from, String to,
String subject, String messageBody,
String[] attachments) throws
MessagingException, AddressException
{
// Setup mail server
Properties props = System.getProperties();
props.put("mail.smtp.host", mailServer);

// Get a mail session
Session session = Session.getDefaultInstance(props, null);

// Define a new mail message
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new
InternetAddress(to));
message.setSubject(subject);

// Create a message part to represent the body text
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText(messageBody);

//use a MimeMultipart as we need to handle the file attachments
Multipart multipart = new MimeMultipart();

//add the message body to the mime message
multipart.addBodyPart(messageBodyPart);

// add any file attachments to the message
addAtachments(attachments, multipart);

// Put all message parts in the message
message.setContent(multipart);

// Send the message
Transport.send(message);


}

protected void addAtachments(String[] attachments, Multipart
multipart)
throws MessagingException, AddressException
{
for(int i = 0; i<= attachments.length -1; i++)
{
String filename = attachments[i];
MimeBodyPart attachmentBodyPart = new MimeBodyPart();

//use a JAF FileDataSource as it does MIME type detection
DataSource source = new FileDataSource(filename);
attachmentBodyPart.setDataHandler(new DataHandler(source));

//assume that the filename you want to send is the same as the

//actual file name - could alter this to remove the file path

attachmentBodyPart.setFileName(filename);

//add the attachment
multipart.addBodyPart(attachmentBodyPart);
}
}

public static void main(String[] args)
{
try
{
SENDMAIL MAIL = new SENDMAIL();
String server="pop3.gmail.com";
String from="username@gmail.com";
String to = "other user href="mailto:name@gmail.com">name@gmail.com";
String subject="Test";
String message="Testing";
String[] filenames =
{"c:/somefile.txt"};

MAIL.sendMail(server,from,to,subject,message,filenames);
}
catch(Exception e)
{
e.printStackTrace(System.out);
}

}
}
i want to send mail using this code but i getting exception like this.
avax.mail.MessagingException: Unknown SMTP host: pop3.gmail.com;
nested exception is:
java.net.UnknownHostException: pop3.gmail.com
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1543)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453)

at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at SENDMAIL.sendMail(SENDMAIL.java:46)
at SENDMAIL.main(SENDMAIL.java:85)
Caused by: java.net.UnknownHostException: pop3.gmail.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:267)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:227)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1511)
... 8 more
i have taken code from this siite only plz suggest me how to remove this
exception.
thanks in advance.
goldie's blog

Bubble Graph by bb on Wed 11th Mar 12pm

I love this graph

href="http://www.osix.net:80/modules/folder/index.php?tid=28125&action=
vf">bubble graph

src="http://www.osix.net:80/modules/folder/index.php?tid=28125&action=v
f" border="0" />
bb's blog

My online resume! by ketan404 on Mon 9th Mar 8am

It is here
href="http://www.listoffreelancers.com/profiles/ketankulkarni">http://www.l
istoffreelancers.com/profiles/ketankulkarni

Simple and clean design. I like this website.

Ketan
ketan404's blog

About Me
n:
View my Profile

Link To Me
My Rss Feed
My Blog
My Articles
My Profile


 

     
Your Ad Here
 
Copyright Open Source Institute, 2006