Can't execute my Sending a message program

import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
public class SendEmail {
public static void main(String args[])
/**test if a argument is prompted */
if (args.length != 0) {
System.err.println(" 3 arguments required : <username> <password> <emailaddr>");
/* String username = args[0];
String password = args[1];
String emailaddr = args[2];
String host = "smtp.dial.oleane.com";
String to = "[email protected]";
String from = "[email protected]";
String subject = "test";
String MessageText = "blabla";
boolean sessionDebug = true;
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.transport.protocol", "smtp");
Session session = Session.getDefaultInstance(props,null);
session.setDebug(sessionDebug);
try{
System.out.println("titi");
MimeMessage msg = new MimeMessage(session);
System.out.println("toto");
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO,address);
msg.setSubject(subject);
msg.setSentDate(new java.util.Date());
msg.setText(MessageText);
Transport.send(msg);
catch(MessagingException mex){
System.out.println("Error on sending a mail ");
mex.printStackTrace();
I have an error on the following instruction :
MimeMessage msg = new MimeMessage(session);
Atteint exception java.lang.ClassNotFoundException non captur�e
Can sommebody help me ?
Thanks a lot

ah, got the problem. In ur machine the Java Activation Framework is not installed or is not in the classpath. Javamail needs JAF to function.
Please check. That will effectively solve the problem

Similar Messages

  • Can any one please send me sample programs using java mapping..

    <b>Can any one please send me sample programs using java mapping with input and output?</b>
    please let me know how to get started with java mapping?
    Prerequisites for java mapping ?
    What are the jars need to be deployed for SAX,DOM.  And how to do it in NWDS?
    Use of Execute() and setparameter() ... StreamTransformation?
    Some sample program using java mapping with simple logic(input and output)?

    Hi,
    Did you go thro these blogs?
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Nice blogs to start Java Mapping.
    Go thro this one too.
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • Hi! I brought an iPhone 4 off my friend at work. The day I brought it, it was working fine but now I can't seem to send any messages or make phone calls. The network is showing up fine but each time I try to make a call it says "call failed" help any1?

    Hi! I brought an iPhone 4 off my friend at work. The day I brought it, it was working fine but now I can't seem to send any messages or make phone calls. The network is showing up fine but each time I try to make a call it says "call failed" I can't seem to send any messages either? I can use the Internet fine and everything else on the phone. Can anyone help?

    Hi chelsinator,
    You can reset the phone and it won't cause any problems or cause you to lose any data - Hold down the Home and Power buttons at the same time and continue to hold them down until the Silver Apple appears.
    The other thing you should do is to reset your network settings: Settings>General>Reset>Reset Network Settings. You will have to set up your Wifi again, but that oftentimes clears things up.
    Cheers,
    GB

  • How to use canon pixma MX377. I can't receive and send fax messages

    Can please anyone send me complete instruction manual in english for my pixma canon MX377 machine because I can't receive and send fax messages. I'm connected to a PBX extension line or a xDSL splitter. Every time i called a person on the machine, I can hear him but he can't hear me. Thank you very much.

    Hi rgc,
    The PIXMA MX377 user's manual is available in an online format and can be downloaded from the Canon Asia website.  The following link will take you to the Manuals page for the PIXMA MX377:
    http://support-asia.canon-asia.com/P/search?model=PIXMA+MX377&filter=0&menu=manual
    Once on the page, please scroll through the list and select the manual that corresponds to your operating system (Windows or Mac), then click the DOWNLOAD NOW button on the following page that appears to download and view the manual.
    This didn't answer your question or issue? Find more help at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I can't make a call but i can received calls and send text messages its say you cannot make a call check the phone settings!

    i can't make a call but i can received calls and send text messages its say you cannot make a call check the phone settings!

    It is not a cell phone.

  • New iphone can't receive or send text messages

    I can't receive or send test messages. I tried turning airplane mode on and off. I also don't seem to have a data plan added to my service. I looked at my contract and it just shows family talk. I thought they automatically add this to iphone contracts.

    It doesn't display an error message. It sends it out, but the recipient never receives it. I think the Best Buy person screwed up my service some how. She didn't sign me up for a data plan or a text message plan for this account. I was supposed to keep my same plan. It should still send texts though (at a higher non-text plan rate).

  • Help!!! I can't receive or send text messages...only imessaging

    How can I get my new iPhone 4s to send and receive text messages?

    Hi, I have a ipod touch 3g with the latest ios 5.  I can't seem to send text messages via the green "message" icon.  The imessage icon is on but it doesn't work....would you know of anything else I can do to allow messages to send and receive??  thanks

  • How can i execute vb scripts in java program

    hi
    how can i execute any batch files or any other exe files (vb scripts) from java programs
    thanks

    Hi,
    You use Runtime.exec to execute commands / exe-files. See the documentation (and remember that it will only work on windows):
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    /Kaj

  • I can make calls and send text messages on my new iPhone 5, but incoming calls and texts still go to my old (non-Apple) phone. Is this a problem with the phone set up, or is it a problem with my old carrier or my new carrier?

    I can make calls and send texts on my new iPhone 5,  but all incoming calls and texts are received by my old (non-Apple) phone.

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • I can't receive or send text messages, other than iMessage

    i cant receive or send text messages other than i message. HELP.

    Me neither. It is really annoying. Did you ever get it figured out?

  • Is my iPad limited to iMessages? I can't seem to send text messages to non iPhone/iMessage users...grrrr

    Frustration is setting in after using my new mini iPad. My text messages seem to be limited to iMessages!?  Horrible since my friends and family are not all iphone users!  Is my iPad limited to iMessages? I cant text my daughter who has the Droid or others that don't have iMessage users!!!

    The phone number on the iPad is not active for cell voice, only for cellular data. You are not paying anything for voice or SMS (texting services) on your iPad, only for cell data. Texts to non-iOS devices would have to be SMS and use the cell voice system which is not present on your iPad.
    There are apps, such as TextFree, which will assign you a virtual phone number and allow you to emulate sending SMS messages from and to your iPad.

  • Can't open or send text messages. Need help please.

    My sprint 700p will not let me access my messages. I can open the messaging app. but if i try to open the message the phone resets itself. I tried to see if i could recieve a text but when I get a incoming text the phone resets itself again. I've tried hard and soft resets still the same. Right now I'm willing to try anything reasonable to restore my texting capablities.
    Post relates to: Treo 700p (Sprint)

    Whenever you preform the hard reset do you restore your data back to the device?
    Try hard resetting your device and then see if the messaging application resets when someone sends you a message if it doesn't then it is the messaging application that has become corrupted.
    The best method of getting rid of this problem is to locate your backup folder and remove it.
    The folder is located in C:/program files/palm/[username]
    The username folder is going to be a variation of your hotsync ID. (You can find this in Palm desktop and the hotsync application of your device)
    Inside that folder is a folder that says backup..rename this to backup.old once it is renamed then hotsync your other data back to the device.

  • Can't input text, send in message window

    When creating an outgoing email in Mail (both new and replies), I can only type about 5 characters in the main message area before I get a "clonk" system error sound. At the same time, I cannot enter anything in the Subject field. The system is not frozen, as I can still input addresses. But when I click Send, I get the same system error sound.
    I have two accounts set up on my iMac. Both accounts have .Mac email accounts using OS X Mail, but I only have this problem with one account on this computer (i.e., I can send email fine from the second account.)
    Any help will be appreciated.
    iMac (Flat Panel)   Mac OS X (10.4.8)   iMac (Bondi Blue Rev. A)

    This problem in Mail is usually caused by some Launch Services cache or preferences corruption. The following article describes how to manually reset Launch Services -- the notes at the bottom of the article also provide information about the side effects of deleting each of the files involved:
    Resetting Launch Services
    If you prefer using a cache cleaning utility instead of following the manual procedure described in the previous article, this other article provides links to some utilities that can be used for troubleshooting and cache cleaning:
    Resolving Disk, Permission, and Cache Corruption
    It seems that the most appropriate utility for solving this particular problem is Tiger Cache Cleaner, but you may also want to consider other utilities, such as OnyX, or Cache Out X, which are free. Whatever utility you choose, be sure to read this first:
    Side effects of System cache cleaning
    As an example, this is how you should proceed with OnyX:
    1. Quit all applications.
    2. Launch OnyX and enter your administrator password.
    3. Click Maintenance. In the Reset section, check LaunchServices database.
    4. You may uncheck any other pre-checked options if you wish.
    5. Click the Execute button.
    6. Restart the computer.

  • I can't send mail via hotmail. I can read new mail, but can not reply or send new messages.

    I am using a mac powerbook, 2004 running MAc os x. Yes, I know it is old. But I only use if for e-mail. this week, I can't send or reply to messages via firefox or any other browser. I can't succesfully download updates. Can you advise?
    thanks
    Sharon

    Go to Mail Preferences- Accounts and confirm you are providing Gmail what they require to send and receive mail. And DON'T specify Secure Socket Layer. Some mail accts don't like SSL
    Good Luck to you.

  • Important! Can IDS 4.1x Send event messages to a syslog server??

    I know IDS event view and MC can pull the IDS event from IDS sensors and IDSM. But our company is think to collect all the security message in a syslog server. firewall can send syslog to this server. But for IDS and IDSM 4.1, I can't find a way to send the IDS event to syslog server. Is there any way to do that????
    I am really appreciate if you can help me,thanks.

    You comment is an easy statement to make, but IMHO unfair.
    If you look at the Cisco IDS/IPS product line's history, you'll realize that the current RDEP/SDEE communications model is infinitely more secure, while remaining easy to use, than any other method one could propose.
    Initially, the sensors pushed events to the centrally monitoring console via UDP (port 45000), with most of the data in the clear (the source and destination IP address were obfuscated). This is obviously not very safe because, even though the communications were pseudo connection-oriented due to checking by the application daemons at each end, it is possible to intercept and modify the IDS alert to inject false data.
    This same problem exists with stock syslog, since everything goes on the wire as a UDP packet and there is no data obfuscation or encryption what so ever.
    The distinct advantage to the current communications model is the fact that RDEP/SDEE use cryptography to protect your IDS/IPS alerts, and that is also uses a standards-based structure in XML-based forms to pass the data.
    Finally, since Cisco has released an SDK for RDEP/SDEE, and many 3rd party vendors have software that can act as RDEP/SDEE clients, I disagree that you’re stuck with the CiscoWorks-based VMS suite. Besides, you only have to buy the suite if you need to manage more than 5 sensors, but I digress...
    Alex Arndt

Maybe you are looking for

  • How do i synchronize ipod nano music with my new mac. v

    How do I sync the music on ipod nao with new mac. Itunes library is almost empty. when i sync my empty library on mac will delete all music on ipod

  • Connect iPhone to Projector?

    Guys, Can any one let me know of how to use the iphone to connect to a projector so that we can simply demonstrate the application on a large screen? (just as shown in Keynote!!) Earlier response is appreciated. Thanks, Goldeni

  • Help i can't run reason 5 on lion!

    I just got a new mac book pro with lion and I went to install propellorhead's reason 5.0 and it installed fine....howevery,  every time i try to open it i get a "failed to open midi support library" message. This is extremely frustrating and I can't

  • DeepCopy() behaviour

    Hi all, Having been pounding my head against the wall for a couple of days I just wanted to give you heads up on what I discovered. Don't know if this behaviour has already been documented but I've not found any useful info about this. I have a TLF-e

  • Smartforms-item text

    Hi exports, I want to add item text for my form. The condition is Read_text or internal text structure where id = vbbp language= nast-langu.Name = a concatenated vbak-vbeln and vbap-posnr abd object = zcri. I am call function module Read_text in edit