Using the MAIL command of UNIX through JAVA

Can any one give me a lead or example on how to call the MAIL command of UNIX to send mails using JAVA.

Use java.lang.Process for it. See the code below, it will
help you understand how it would be possible.
Process p = Runtime.getRuntime().exec("mail username");
in = p.getInputStream();
out = p.getOutputStream();
Now stdout will be available on 'in' for reading e.g.
you can expect Subject: and Cc: lines on linux box.
and write data/message to 'out'. It will be the message
which you will wrile in normal use of mail on stdin.
Good Luck
Mumtaz Siddiqui

Similar Messages

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • Executing "at" command of UNIX through JSP

    Friends,
    1. "at" command in UNIX execute Unix command at a scheduled time. 2. For each user there will be a table maintained internally which can be accessed by "at" with "-l" argument.
    3. A mail will be sent to the owner with the output of the commands as a message.
    I tried to run the "at" command of Unix in JSP, which gets succesfully executed in Oracle 10g App Server container (Installed in Solaris machine). I have tested the successful execution of command with the log file. But I haven't got any mail for the output. If anyone had any idea, please help me.
    The code I have wtitten is
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(new String[] {"sh","-c","at 2115 Dec 7 < /export/home/usr1/abc.sh"});
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    logger.info("<ERROR>");
    while ( (line = br.readLine()) != null)
    logger.info(line);
    logger.info("</ERROR>");
    int exitVal = proc.waitFor();
    logger.info("Process exitValue: " + exitVal);
    My doubts are:
    1. Who is the owner of the output of "at"command, which gets executed under Oracle 10g App Server container?
    2. If no one is the owner, then where will the output of "at" command will go?
    3. Is there any other way to execute "at" command of UNIX in java program? If so, then please help me.
    Thanks in advance.
    regards
    Nandha Kumar.M

    I would imagine the process call out will be under the guise of the process owner of the OC4J instance which executing the call.
    Have you seen anything different.
    cheers
    -steve-

  • Files creatd in Unix through java, URGENT

    Hi,
    While creating files in unix through Java, by default created files have only permission:
    -rw-r--r--, actually I need full permissions(-rwxrwxrwx ) for the files created through java in unix. Any idea how can we do this?
    Your help would be greately appriciated.
    Thanks,
    Anand

    I doubt that you will be able to get execute permissions set on normal files by setting the umask. You may have to use Runtime.exec() to invoke chmod, or call chmod via JNI if it is something you do often.

  • TS2834 I've been using the mail app that came with my Mac for over a year. Out of the blue, it will not open and keeps saying "Mail cannot open because of a problem" and something about not being compatible ??? Help! I miss my mail

    I've been using the mail app that came with my Mac for over a year. Out of the blue, it will not open and keeps giving me an error like "Mail cannot open because of an error and something about it not being compatible. Please help! I miss my mail

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Using the env variable of unix in a procedure call

    hi,
    how can i use the environment varible of unix in a oracle procedure call ?
    I am working woth shell scripts and it hold some value into a variable and that varible value I want to pass into a oracle procedure.
    i'm sending the sample code and please let me know the solution for this as early as possible.
    actual_file_name=`head -1 temp | tail -1`
    $ORA_BIN_HOME/sqlplus $USER $PASSWD@$TNS
    exec procedure($actual_file_name);
    if i write like above it is not supporting and I tried in so many ways. but no use.
    pls help me.
    suresh.K

    See one possible solution using SQL*Plus command line:
    Re: accessing unix environment variable in oracle procedures

  • Export to PDF - Can a single report (rpt file) create multiple PDF files using the export command?

    Post Author: markeyjd2
    CA Forum: Exporting
    Greetings forum members,
    My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
    In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records.  When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
    What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record.  The file names would be based on the table's primary key.
    Is this possible?

    Post Author: Micha
    CA Forum: Exporting
    Hi,
    you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
    Here's an abstract of the ASP code I use:
    First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
      oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
    Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
    Micha

  • I have a Mac Air. I use the mail application all the time.. The red, yellow, and green buttons disappeared at the top of screen... now i have to force quit mail.. how do it get the buttons back?

    I have a Mac Air. I use the mail application al the time. THe red, yellow, and green buttons disappeard. i have to force-quit now to close mail.. How do i get the buttons back? thanks.

    Mail window may be in the Full Screen mode.
    Move the mouse pointer to the top right corner of the Mail window and hold it there.
    Menu bar should drop down and click the blue double arrow icon.
    Full Screen toggle shortcut:  control + command + F

  • Using the javac command

    I'm trying to create a class with the javac command. I used notepad to write the code and saved the file as .java, but when I try to use the javac command to compile it I'm told that it can't read the file. Not sure what the problem is. Any help is appreciated. Thanks.
    - rob

    Notepad will try to save any file with .txt as the extension. In the Save As dialog, even if you type factorial.java, Notepad might save the file as factorial.java.txt. If you look at the file in a Windows folder, it might display as factorial.java. To find out if this is your problem, use the DIR command in a DOS console to display the actual file name. If this is the problem you can (1) put double quotes around the file name in the Save As dialog, "factorial.java" or (2) make .java a text file type for your system.

  • Cannot determine the ipaddress using the ifconfig command

    cannot determine the ipaddres of solaris OS. I have my oracle db installed on Solaris OS using vmware.
    But I cannot determine the ipaddress using the ifconfig command.
    My native OS is windows vista enterprise. I want to connect my database installed on solaris OS on a vmware machine through TOAD
    Native OS:windows vista enterprise
    Toad :10.5
    OS:solaris 10
    vmware version:6.0.4
    Database:10.2.0
    Pasting the details below.
    # ifconfig
    usage: ifconfig <interface> | -a[ 4 | 6 | D ][ u | d ][ Z ]
    [ <addr_family> ]
    [ <address>[/<prefix_length>] [ <dest_address> ] ]
    [ set [ <address>][<prefix_length>] ] [ <address>/<prefix_length>] ]
    [ destination <dest_address> ]
    [ addif <address>[/<prefix_length>] [ <dest_address> ] ]
    [ removeif <address>[/<prefix_length>] ]
    [ arp | -arp ]
    [ auto-revarp ]
    [ broadcast <broad_addr> ]
    [ index <if_index> ]
    [ metric <n> ] [ mtu <n> ]
    [ netmask <mask> ]
    [ plumb ] [ unplumb ]
    [ preferred | -preferred ]
    [ private | -private ]
    [ local | -local ]
    [ router | -router ]
    [ subnet <subnet_address>]
    [ trailers | -trailers ]
    [ token <address>/<prefix_length> ]
    [ tsrc <tunnel_src_address> ]
    [ tdst <tunnel_dest_address> ]
    [ auth_algs <tunnel_AH_authentication_algorithm> ]
    [ encr_algs <tunnel_ESP_encryption_algorithm> ]
    [ encr_auth_algs <tunnel_ESP_authentication_algorithm> ]
    [ up ] [ down ]
    [ xmit | -xmit ]
    [ modlist ]
    [ modinsert <module_name@position> ]
    [ modremove <module_name@position> ]
    [ group <groupname>] | [ group ""]
    [ deprecated | -deprecated ]
    [ standby | -standby ]
    [ failover | -failover ]
    [ zone <zonename> | -zone ]
    [ usesrc <interface> ]
    [ all-zones ]
    or
    ifconfig <interface> | -a[ 4 | 6 | D ] [ u | d ]
    auto-dhcp | dhcp
    [ wait <time> | forever ]
    [ primary ]
    start | drop | ping | release | status | inform
    when i give the command ifconfig -a, it is only showing the inet address
    # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    Thanks in advance
    Edited by: user13364377 on Aug 21, 2010 12:13 PM

    user13364377 wrote:
    cannot determine the ipaddres of solaris OS. I have my oracle db installed on Solaris OS using vmware.Then it is not configured... I mean, if the ifconfig command does not return an interface and IP address, then surely the initial reaction should be "+oops, I made a config error+" and not "+bug/error!! wtf is going on!?+".

  • Reducing apps size using the "strip" command

    Hello,
    I'm trying to create a Terminal script to reduce all my apps size, using the "strip" command.
    Therefore, I have to look up into all the .app packages of my hard drive to find all the exec files, and then apply the strip command to them.
    The thing is I am a complete newbie, and all I come up with is : (without the ")
    "find . -name "exec" -exec strip '{}' \;"
    But it doesn't seem to work at all...
    I think this is due to the name reference.
    -> How do I find Unix executable files (even inside the .app packages) using the "find" command?
    -> And how do I correctly apply the "strip" command to them?
    thanks for your help!

    wykazox wrote:
    "find . -name "exec" -exec strip '{}' \;"
    I think that you need to check the -perm option of find.
    Mihalis.

  • Caution About Using the Email Command

    I have just done preliminary investigation into a potential problem with using the Email command in Aperture (2.0.1). If Mail Preferences/Composing are set to use RTF, then even a single selected photo that results in an email message (where no text whatsoever is entered) is preceded with some extraneous headers, and quite a bit of HTML code. This will trigger the problems recipients using Outlook and Outlook Express (but not limited to those email clients) are well known to have with attachments appearing to be embedded in HTML code resulting from Mail.
    If the Compose preferences are set in Mail to use Plain Text, then nothing precedes the attached image, unless something is typed, intentionally.
    This defeats the automatic conversion to Plain Text that Mail normally uses when only one font, and no multiple size or colors for that one font, are used. While I keep my Compose preferences set to use RTF, typically, I have relied upon the auto conversion to Plain Text to keep my messages from being problematic to certain recipients.
    There would appear to be no purpose in the extraneous headers and HTML being added as a result of the Email command. I have not gone back and tested Aperture 1.5.x for this issue.
    Btw, you will not see the extraneous headers nor HTML without using View/Message and choosing Raw Source.
    Ernie
    Message was edited by: Ernie Stamper

    Quote from: xmad on 26-June-13, 22:22:57
    Or wait for the platform and program to mature a little bit. Whenever you buy brand new cutting edge material there are bound to be some flaws.
    Best to report your complaint directly to MSI.
    >>How to contact MSI.<<
    Oh yes, when I bought into the Haswell platform I knew there were going to be maturity speed bumps and that was part of the risk in the buying decision.   I just couldn't see shelling out nearly the same amount of money for the 1155 socket and processor that had essentially been stamped EOL.  Besides, how else do you get the intense satisfaction of beta-testing a very expensive platform for future users? 

  • Getting Sql Exception while using JDBC/ODBC to Excel 2007 through Java

    Iam getting the SQLexception by trying to connect using JDBC/ODBC to Excel 2007 through Java. Any Guys can tell abt this problem. java.sql.SQLException: [Microsoft][ODBC Excel Driver] External table is not in the expected format.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at InteractWithExcel.main(InteractWithExcel.java:13)

    From [Google Groups|http://groups.google.co.uk/group/sybase.public.powerbuilder.general/browse_frm/thread/97fbab02a5e6d45b]
    To use Excel as a datasource, you need to defined a named range in the spreadsheet, with the first row containing the column names.

  • Why would I want to use the mail icon on my dock?

    Hi all,
    As I'm endeavoring to further my knowledge on the Mac, I'm curious as to know if I'm losing out on not using the mail icon on my dock.
    Any particular reason I should use it? I currently use yahoo and gmail. I think they're considered IMAP technology and I can access it anywhere any anyhow as long as I have access to the web. I also use my iphone to access it.
    So... why would I want to use the mail icon on my dock? Are the reasons going to be for the characteristics for POP? I.E, can off load mail to my Mac and read later without having live access to web?
    BTW, if I did want to setup mail on the dock. What is the incoming and outgoing mail server for yahoo? Sorry, could locate that info. in yahoo mail.
    Thanks in advance.

    I think you are asking why you should use the Mail application versus using "web mail" through a web browser, and not just about the Mail icon on the Dock, is that correct?
    You should use whatever is more convenient.
    Mail is a standalone application designed for email access, so it is more responsive and has more features. Web-based apps are getting much better, but you can still tell you are in a web browser. You can work off-line, even if you use an IMAP service (such as MobileMe). You can save emails locally, even if most emails are on the server, and if it's POP, all your messages are downloaded to a local database (that may or may not be an advantage to you).
    Mail is integrated with Address Book and iCal (and other Apple apps). You can use Time Machine to recover individual deleted emails, just like you would recover deleted files or folders (using the +flying through space+ interface).

  • How can I re-use the mail address I signed when I was testing MobileMe?

    A few months ago, I tested mobile me and sigend on a me.com email address. I didn't take the anual subscription so the testaccount was closed fur using but is still existing. Now, I'd like to use the mail address for the cloud services, but I says, -already taken. When I try to log in with the old address it says: account expired.
    What can I do to re-use the old address?
    Thank you,
    Oliver

    Try http://me.com/move/

Maybe you are looking for

  • Old Generation not cleaned after Promotion Failure

    Hello, Using Java 1.6.0_29 with a 45GB heap, we occionally see promotion failiures like this 2012-03-28T07:37:00.939+0200: 484094.380: [GC-- [PSYoungGen: 14615647K->14615647K(14615680K)] 44825709K->46072922K(46072960K), 154.0113697 secs] [Times: user

  • Audio for Quicktime

    I want to record some sounds for my Mail application with Quicktime and put them in my user>library>sounds so they would have to be something other than movie. Can that be done and if so, how? TIA

  • The screen on my iPhone 4S won't turn on, it only goes black with blue vertical lines

    So my iphone 4s can recieve texts and i can use the touch screen but the screen itself is black with horizontal blue stripes, which means that i cannot see anything that is happening on my phone. Everything is working other then the screen... Can any

  • Twice as much disk space used on external HD for TM than internal HD

    Disk Utility shows the amount of disk space used by TM as 86 GB whereas the HD only shows 45 GB used. Also, the number of files and folders have nearly doubled in size. This from only two days of using TM. My Seagate FreeAgent Go External Hard Drive

  • Downloaded PSE 8 - How to save backup to disc

    Simple enough. I bought and downloaded the program from the Adobe site.  Getting ready to get a new computer and want to move the program over to the new one.  I assume the easiest way to do this would be to burn a copy of the program to disc.  Is th