Monday, May 7, 2007

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

Hi vikas,

You can run this demo Application directly like simle Java Program.
But you need to download "http-email-commons.jar" from this group
files section.
You set classpath to that jar file, Then you run this demo.

Ok

Regards,
Thirupathi.

--- In completeJava@yahoogroups.com, "vikas_impetustech"
<vikas_impetustech@...> wrote:
>
> 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
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Need traffic?

Drive customers

With search ads

on Yahoo!

Y! Greetings

Mothers Day eCards

Send eCards to all

the Moms you know

.

__,_._,___

No comments: