E-Mail Home!

Hi!
In this code to send e-mail from my app ... can I have the e-mail message be from a "log.txt" file on my computer?
This code now reads text for the body of the e-mail from "This is the text sent in the E-Mail Message!"
package AddRFSwitchPac;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import javax.mail.*;
    import javax.mail.internet.*;
    public class SendApp {
        public static void send(String smtpHost, int smtpPort, String from, String to, String subject, String content)
                throws AddressException, MessagingException {
        FileReader in = null;
            // Create a mail session
            java.util.Properties props = new java.util.Properties();
            props.put("mail.smtp.host", smtpHost); 
            props.put("mail.smtp.port", ""+smtpPort);
            Session session = Session.getDefaultInstance(props, null);
            // Construct the message
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress(from));
            msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
            msg.setSubject(subject);
            msg.setText(content);
            // Send the message
            Transport.send(msg);
        public static void main(String[] args) throws Exception {
            // Send a test message
            send("smtp.comcast.net", 25, "[email protected]", "[email protected]",
                 "re:Days INN (Bristol)Movie Log Report", "This is the text  sent in the E-Mail Message!");
    }Thanks!

     File f = new File("pathto/log.txt");
     try {
      FileReader in = new FileReader (file);
      BufferedReader dis = new BufferedReader (in);
      StringBufer sb = new StringBuffer () ;
      while ((line = dis.readLine ()) != null) {
            sb.append (line + "\n");
      in.close ();
      send("smtp.comcast.net", 25, "[email protected]", "[email protected]",
                 "re:Days INN (Bristol)Movie Log Report", sb.toString ());  
    catch  (IOException e ) {
       e.printStackTrace();
    }         something like that?

Similar Messages

  • My yahoo mail home page is in French. How do I change it to English?

    The headings from each e-mail are also in French, which I want changed back to English. How can I change my Yahoo! mail home page and e-mail headings to English?

    Hello renard987333,
    you need to clear your cache and maybe delete the cookies from Yahoo!.
    Try changing your language on Yahoo! and then do this or do it after... whatever works. Let me know how it goes.

  • How do I check Mac-mail (home) from work (Mac)?

    How do I check Mac-mail (home) from work (Mac)?
    W.W.

    I know one service as long as you remember your server info and password:
    http://www.mail2web.com/

  • Mail home directory is full

    I'm getting this error in Mail:
    Mail cannot update your mailboxes because your home directroy is full.
    You must free up space in your home folder before using Mail. Delete uneeded documents or move documents to another volumne.
    Any suggestions on how or where I should do this?

    Quit Mail first and using the Finder, go to Home > Library > Mail. Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Using the Finder, go to Home > Library > Mail > Envelope Index.
    Move the Envelope Index file to the Desktop.
    When re-launching Mail, you will be prompted to import all mailboxes located within the Mail folder at Home > Library > Mail.
    Select OK and allow the import process to complete.
    This should resolve the problem.
    If so and after confirming all mailboxes were successfully imported and are available, you can delete the copy of the Mail folder and the old Envelope Index file from the Desktop.

  • Mail "Home Directory is Full" again

    Allan Sampson said on 6th July 2006 "With the Mail.app quit and using the Finder, go to Home > Library > Mail > Envelope Index. Move the Envelope Index file to the Desktop.
    After doing so, copy the Mail folder and place the copy on the Desktop for backup purposes.
    Launch Mail and you will be prompted to import all mailboxes available within the Mail folder at Home > Library > Mail.
    Select OK and allow the process to complete. This isn't really importing anything but replacing the Envelope Index file and re-indexing all mailboxes.
    This should resolve the problem
    After confirming all mailboxes and messages are available, you can delete the copy of the Mail folder and the old Envelope Index file from the Desktop."
    I have done all that Alan has outlined but all I get now in the beachball rotating for at least 20 minutes. If I go to the desktop I cannot access mail and if I force close Mail it comes up with the same "Home directory is full". In case I got it wrong first time, I've now repeated it three times with the same result the spinning beach ball which never stops. Help!
    Mac mni   Mac OS X (10.4.7)   I have five macs and two PCs

    Verify/repair your disk first (not just permissions), as described here:
    The Repair functions of Disk Utility: what's it all about?
    After having fixed all filesystem issues, if any, try the following variation of the procedure to re-create the index (it could be that you didn't also get rid of Envelope Index-journal, for example):
    1. Quit Mail if it's running.
    2. In the Finder, go to ~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong -- e.g. by dragging it to the Desktop while holding the Option (Alt) key down.
    3. Locate Envelope Index and move it to the Trash. If you see an Envelope Index-journal file there, delete it as well.
    4. Move any "IMAP-", "Mac-", or "Exchange-" account folders to the Trash. Note that you can do this with IMAP-type accounts because they store mail on the server and Mail can easily re-create them. DON'T trash any "POP-" account folders, as that would cause all mail stored there to be lost.
    5. Open Mail. It will tell you that your mail needs to be "imported". Click Continue and Mail will proceed to re-create Envelope Index -- Mail says it's "importing", but it just re-creates the index if the mailboxes are already in Mail 2.x format.
    Note: For those not familiarized with the ~/ notation, it refers to the user's home folder, i.e. ~/Library is the Library folder within the user's home folder.

  • Help  -  "mail home directory full?

    hi,
    I have been using my Mail account for ages. This morning I openned mail but a message popped up saying "MAIL CANNOT UPDATE YOUR MAILBOXES BECAUSE YOUR HOME DIRECTORY IS FULL. You must free up space in your home folder before using Mail. Selete unneeded documnet or move documents to another volume. (Blue Quit Button).
    We I searched the usual and went to Users/me/library/mail. I openned that and went to my POP account, openned up the mail boxes for inbox etc. I copied the .emlx messages into a folder and put them on the desktop, thinking that would free up some space. It didn't. I did a restart ... same message happens.... The mail bar opens but everything is grey, the message above pops up and I have no choice but to quit.
    I can't access any of my mail. When I try to open one of the .emlx files on the desktop, the same message above opens. I am at a loss!
    Could someone please help. I can't even get the About Mail to open so that I can tell you what I version I have, but I do update everything.
    thanks

    With the Mail.app quit and using the Finder, go to Home > Library > Mail.
    Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Using the Finder, go to Home > Library > Mail > Envelope Index.
    Delete the Envelope Index file and empty the Trash.
    Launch Mail and you will be prompted to import all mailboxes available in the Mail folder at Home > Library > Mail. Select OK and allow the import process to complete.
    This isn't really importing anything but replacing the deleted Envelope Index file and re-indexing all mailboxes and should resolve the problem.
    After confirming all mailboxes and messages are available, you can delete the copy of the Mail folder placed on the Desktop.

  • Having troubles with work files I mailed home...

    Hello,
    Twice I mailed myself a couple of files to work on at home and twice I was given errors. The first time, I mailed a lightwave model and a Lightwave Scene home, and both were corrupted. When I tried to open them in Lightwave, they tell me there was an error reading the file.
    I thought maybe something got garbled in the transition, so I zipped the folder and sent it home that way. I now get an error when trying to unzip the file - 'Error-1, Operation not permitted' is what I get.
    As far as I can tell, it's not a permissions problem. I downloaded stiffut expander, and it won't help either.
    I'm running 10.4.8 on both machines and have never had this problem before. I recently wiped and reinstalled my work machine, but I still have everything up to date.
    The work machine is DC 2.3 and home is below... and FWIW, I have rechecked the files at work and they are just fine.
    Any suggestions?
    Thank you.
    -Vincent

    Vincent, I am not sure that this is the answer you want, but I have found that some programs will create an obscure format that many mail services can not read. and they will simply change the format before they forward it on because they do not recognise the file type or the format in which it was created.
    I have one paricular program that falls in this category.
    It will automaticly convert this file to a data file, and of course it is not a data file at all but an image file that has one of these obscure formats I mentioned above.
    The only way I have found a work around is to use a web based e-mail account and retrieve the file from there server rather then your e-mail program.
    I have and use pop server at home and use Yahoo mail when I run into this issue, So far it has worked, you might give it a try.
    Don

  • Cannot open mail "home folder is full" after importing mail folder from time machine

    hello, sorry for my poor english.
    after an erase and reboot of my harddisk with new os yosemite installed, i've copied the mail folder from the time machine backup. but when i tried to open mail app it start to "import the mail box" and then stops saying that the home folder ins full, but it isn't, i've over 300gb free

    What is your hard drive capacity and available free space after deleting a ton of stuff?
    Try the following.
    With the Mail.app quit and using the Finder, go to Home > Library > Mail > Envelope Index.
    Move the Envelope Index file to the Desktop.
    When re-launching Mail, you will be prompted to import all mailboxes located within the Mail folder at Home > Library > Mail. Select OK and allow the import process to complete.
    After confirming all mailboxes were successfully imported, you can delete the old Envelope Index file from the Desktop and this should resolve the problem.

  • HT3226 my mail will just not open, when i try to open it it just gets stuck with the mail home page half open and when i click on the icon at the bottom it says app not responding, is there anything i can do myself or is this a trip to the Apple store?

    My mail app will not open at all, it just gets stuck half open and then when i go to the icon below it says the app is not responding, is this something i can fix myself?

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Quit Mail.
    Triple-click the line below to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Relaunch Mail and test. If the problem is resolved, you'll have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Post your results.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • After updating to latest version mavericks , screen is always jumping to mail home desktop screen,no matter wherever i am in?

    Screen is always jumping back to desktop homescreen after updainng to mavericsk os.

    This thread will help you to get rid of this failure:
    https://discussions.apple.com/thread/5526061?start=0&tstart=0
    The problem is google drive. You can turn off and not use it or you can apply this suggestion
    " If you want to keep using it, the problem has to do with the file sync status option. Open Google Drive preferences and turn off "Show file sync status and right click menu". This way, you'll be able to keep using Drive without the aggravating crashes every 60 seconds."

  • Mail icon bounces, but never launches. HELP!

    Dear People Who Know Macs Better Than Me,
    Please help! Yesterday I was trying to back up my Mail (Home/Library/Mail), and when I saw that it was as big as it was, I tried compressing/archiving the Mail folder using the (Create archive of "Mail") when you right-click on any item.
    BIG mistake. As I was doing that, my computer froze mid-process and I had to force quit out of Finder. I ended up having to force-restart the computer from holding down the power key (since other force-restart options don't work anymore). I should have never tried to archive by creating an archive, I should have just copied the files directly over to another hard drive, which I did later. My computer froze yet again... choked on a file called "173447.emix or .emlx", did I want to continue copying? I hit yes and then the copy/task window showed no further progress. It would not quit process thereafter, not even if I hit that little X up top, and was instead frozen. I had to force quit out of Finder yet again. Totally digressing, but you know how it is. I'm trying to document everything for you here.
    Fortunately I have a backup, but it doesn't have everything from the last two weeks. I did do a manual backup where I dragged all folders inside Mail over from one drive to another.
    So, I've been unable to launch Mail. The icon does its perfunctory dance in the dock, the Mail menu appears at the top of the screen, but nothing else appears, and then it goes dormant and never launches. I have watched Activity Monitor during this process and indeed Mail does launch and appears on Activity Monitor, but then it subsequently and almost immediately quits.
    What file do you think I damaged? Was it the Mail app itself? Or do you think it was a preference file? Please help! Thanks in advance!

    Dear Golden Shoes, thank you very much for that simple fix! After restarting, Finder froze so I restarted with all external hard drives removed and Mail launched this time. Of course none of my passwords or other account settings were saved, but I can easily figure it out. THANK YOU!

  • Letters all spaced out when printing e-mail

    I have a C5280 HP all in one printer, I am on Windows Vista, computer is a HP SR541OF, and AT&T Yahoo mail. Don't know if this is a printer problem or?.
    It just started yesterday all of a sudden, I don't think I changed anything.
    When I print an e-mail  the letters are all spaced out evenly  (about 1/2" apart)    L    i    k    e     T    h    i    s.
    If I print a picture or logo etc. it prints OK, but the date and time stamp are all spaced out..
    Any ideas? I checked on my printer help page and e-mail home page and I don't see anything to fix this. HELP.
    Thanks, David

    I have the same problem. Just started yesterday (3/5/2011). I'm using the HP 3210 all in one. I did recently upgrade to the latest version of Firefox. Maybe that could be the issue.

  • Installed new hard drive, mail re-install not working properly...

    Hi - I replaced the hard drive in my laptop. Before doing that, I backed up my mail folder and my mail preferences folder to a DVD. Now, after installing OSX on the new hard drive, I've copied the file / folder onto the new drive, but mail isn't working properly. It keeps giving me the "welcome" screen instead of just starting up. It wants me to put in my email addresses, etc. Seems like there's a switch somewhere in the OS that tells it this is the first time its been run. If I go through the process, it still doesn't get my preferences right.
    Anyone know what I'm doing wrong?
    The files / folders I'm copying are:
    - Home > Library > Mail
    - Home > Library > Preferences > com.apple.mail.plist
    thanks,
    dave

    Problem was not with mail but with Toast and the DVD I burned using it - arggh.

  • Can't Send MAIL..... again

    hey...
    can;t send mail..
    10.4.10 on a macbook..
    can send mail on my .MAC account, but my MAIL 2.0 is no good. it used to work fine...
    i travel for a living, could the different log-on places have something to do with it.?
    tried all the fixes on the Apple help site, no avail.
    using port 587, removed and re-entered account, internet connection is fine...
    want to use MAIL to send pix from my iPhoto's...
    also, anyone know how to change the name in my account? somehow the spelling of my name is wrong, and every email i send says from 'blank' and it is wrong. looked at every piece of account info and they are all correct. where is the info for FROM: in an email stored...
    cheers..!!!
    ian

    I'm having the same problem. I moved to a different apartment. I think my situation is this; my Mail says home and has my .mac account email address listed. My .mac account says .mac and has my .mac email address listed.
    I've tried to change the Mail "home" so it doesn't say ,mac, but I haven't figured out how and when I change the email and server settings it tell me that it is an invalid directory.
    So it's a circular puzzle and I can't seem to get out.
    Is this your problem too? If not, do you know how to fix this one?
    Message was edited by: rabrat

  • Icon for i cloud suddenly disappeared from mail ?  Not a problem but just concerned that the icon should disappear from the listing for the iCloud e mail account

    I had previosly set up a number of IMAP e mail account in addiiton under my .mac and .me account which is my personal account.
    On the mail home page it had the inbox listing thee accounts and further down the page its used to list the on line accounts set up under I cloud using the same name as the .mac or .me accounts, but also included the i cloud icon as does my ipad.  Logged onto day and the i cloud icon had dissappeared?  not sure why it is still functioning and I still have all my icloud accounts set up but the icon is no longer present.
    Maybe just a bit anal but it bugs me to know why this icon has suddenly dissappeared?

    Hello,
    Do you use these settings in Mail for your Gmail account (especially for the SMTP) ?
    If you use IMAP and all your emails are still stored on the server you can delete your account in Mail and recreate it with the settings mentionned above.
    Hope this will help.

Maybe you are looking for