Monday, May 7, 2007

[completeJava] Hi Friends,....facing problem to run this code !! plz help..it's urgent.

how can i run this code. I alrdy download that file from the group.but
where i hv 2 place that file.
I 'm facing problem while compiling this code. SimpleEmil is not
found..and i start imported packg is also not found.

--- In completeJava@yahoogroups.com, "b.thirupathi"
<thirupathi_reddy_82@...> wrote:
>
>
>
>
> import org.apache.commons.mail .*;
>
> public class EmailDemo
> {
> public static void main(String[] args) throws Exception
> {
> sendSimpleEmail();
> }
> public static void sendSimpleEmail(){
> SimpleEmail email = new SimpleEmail();
> email.setHostName("hostName");
> email.addTo("thirupathi@...
> <mailto:thirupathi@...> ", "Thirupathi");
> email.setFrom("thirupathi@...
> <mailto:thirupathi@...> ", "Me");
> email.setSubject("Test message");
> email.setMsg("This is a simple test of commons-email");
> email.send();
> }
>
> public static void sendEmailWithAttach(){
> EmailAttachment attachment = new EmailAttachment();
> attachment.setPath("EmailDemo.java");
> attachment.setDisposition(EmailAttachment.ATTACHMENT);
> attachment.setDescription("This Java Program");
> attachment.setName("Thirupathi");
>
> // Create the email message
> MultiPartEmail email = new MultiPartEmail();
> email.setHostName("HostName");
> email.addTo("b.thirupathi@... <mailto:b.thirupathi@...> ",
> "Thirupathi");
> email.setFrom("thirupathi@...
> <mailto:thirupathi@...> ", "Me");
> email.setSubject("The picture");
> email.setMsg("Java Program for Sending email with attachment");
>
> // add the attachment
> email.attach(attachment);
>
> // send the email
> email.send();
> }
> }
>
>
>
> for required jar files download http-email-commons.jar file from Files
> Section of completeJava Group
>

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Y! Greetings

Mothers Day eCards

Send eCards to all

the Moms you know

.

__,_._,___

No comments: