anyone knw javamail

R

renkie

hi.
i hav made smtp protocol n i had tried 2 send mail but when i run it
my connection gets failed.
can u give me the solution or hav u any project in smtp?
or can you knw how to run such type of program except java filename...
what will be the Mailhost for such type of program?
 
A

Alex Kizub

For Pete's sake, write in English!

And you spelled "Java" wrong.

Yes. English is bad. But that's not the reason to refuse.
Internet is full of Java Mail examples...

import javax.mail.*;
import javax.mail.internet.*;

import java.util.Properties;

class SimpleMail {
public static void main(String[] args) throws Exception{
System.out.println("Sending mail...");
Properties props = new Properties();
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", "smtp.mymailserver.com");
props.setProperty("mail.user", "myuser");
props.setProperty("mail.password", "mypwd");

Session mailSession = Session.getDefaultInstance(props, null);
mailSession.setDebug(true);
Transport transport = mailSession.getTransport();

MimeMessage message = new MimeMessage(mailSession);
message.setSubject("HTML mail with images");
message.setFrom(new InternetAddress("(e-mail address removed)"));
message.setContent("<h1>Hello world</h1>", "text/html");
message.addRecipient(Message.RecipientType.TO,
new InternetAddress("(e-mail address removed)"));

transport.connect();
transport.sendMessage(message,
message.getRecipients(Message.RecipientType.TO));
transport.close();
}
}

Alex.
http://www.myjavaserver.com/~alexfromohio/
 
R

Roedy Green

For Pete's sake, write in English!

English is clearly his second language. What you are doing is as
pointless as people in foreign countries shouting louder at you to
make you understand them.
 
R

Roedy Green

No one is refusing anything, but leetspeek is ludicrous and illiterate, as
well as intolerable.

I recall a MASH episode with a young man who picked up his English
from soldiers. It was quite cheeky. I suspect the guy you are
blasting has picked up much of his English from reading newsgroups. He
is just repeating what he has seen. His use of netspeak does not
deserve the same degree of slap than use by a native speaker does.
 
A

Arne Vajhøj

Lew said:
"Clearly"? It is not clear at all to me; the leetspeek is just like
what many American youths do. I do not conclude that the OP is not a
native English speaker absent any evidence of that.

What you are doing is as pointless as supporting the obnoxious use of an
illiterate idiom.

The posters IP address points to Australia ...

In general I find it ridiculous to comment on small grammatical
errors or spell it "java" or use an abbreviation as thx. Everybody
can read that. And it is pointless to correct it.

But in this particular case the original post was unreadable.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top