How to send mail from linux with .txt file as attachment ..

I want to send email from linux box and in the body of the email i want to have the content of dblog.txt file.
I want dglob.txt file content to be part of the mail body.
Thanks in advance!!

Apr 29 15:19:35 lctwprddb01 sendmail[1616]: m3TJJZ4k001616: to=[email protected], ctladdr=oracle (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30109, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m3TJJZhB001617 Message accepted for delivery)
Apr 29 16:04:52 lctwprddb01 sendmail[1422]: m3TIP6LJ031388: to=<[email protected]>, ctladdr=<[email protected]> (500/500), delay=01:39:46, xdelay=00:48:01, mailer=esmtp, pri=120423, relay=cluster2a.us.messagelabs.com. [216.82.249.211], dsn=4.0.0, stat=Deferred: Connection timed out with cluster2a.us.messagelabs.com.
Apr 29 16:07:36 lctwprddb01 sendmail[1619]: m3TJJZhB001617: to=<[email protected]>, ctladdr=<[email protected]> (500/500), delay=00:48:01, xdelay=00:48:01, mailer=esmtp, pri=120425, relay=cluster2a.us.messagelabs.com. [216.82.248.44], dsn=4.0.0, stat=Deferred: Connection timed out with cluster2a.us.messagelabs.com.
Apr 29 16:07:52 lctwprddb01 sendmail[1627]: m3TILs2r031176: to=<[email protected]>, ctladdr=<[email protected]> (500/500), delay=01:45:58, xdelay=00:48:01, mailer=esmtp, pri=120429, relay=cluster2a.us.messagelabs.com. [216.82.248.45], dsn=4.0.0, stat=Deferred: Connection timed out with cluster2a.us.messagelabs.com.

Similar Messages

  • Shell Script to send email with .txt file as attachment

    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!

    978334 wrote:
    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!http://bit.ly/XHfSCz
    https://forums.oracle.com/forums/search.jspa?threadID=&q=sendmail&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Sending mail from servers with non-ASCII names

    As part of an effort to internationalize our product we're testing on machines with host names that include non-ASCII characters (accented e's and whatnot). When trying to send mail from these machines we're getting:
    javax.mail.MessagingException: 501 5.5.4 Invalid Address
    at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1634)
    at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:1068)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:458)
    at javax.mail.Service.connect(Service.java:291)
    at javax.mail.Service.connect(Service.java:172)
    at javax.mail.Service.connect(Service.java:121)
    at javax.mail.Transport.send0(Transport.java:190)
    at javax.mail.Transport.send(Transport.java:120)
    at msgsendsample.main(msgsendsample.java:86)
    Looking at a network trace I see the EHLO command being sent as
    EHLO test[0xe9][0xdf]\r\n
    where the machine name is testéß. From a Unicode table 0xe9 0xdf = é ß.
    I found a reference from RFC 5336 (SMTP Extension for Internationalized Email Addresses) that says the hostname in the EHLO must be in the form of ACE (ASCII-compatible encoding) labels:
    3.7.1. The Initial SMTP Exchange
    When an SMTP connection is opened, the server normally sends a
    "greeting" response consisting of the 220 response code and some
    information. The client then sends the EHLO command. Since the
    client cannot know whether the server supports UTF8SMTP until after
    it receives the response from EHLO, any domain names that appear in
    this dialogue, or in responses to EHLO, MUST be in the hostname form,
    i.e., internationalized ones MUST be in the form of ACE labels.
    ACE encoding for my machine would be: java.net.IDN.toASCII("test4éß") --> "xn--testss-eva".
    I'm not sure if this RFC applies in this case - I didn't know anything about the guts of SMTP until yesterday - but it makes sense that you'd need to escape the hostname in the EHLO until you can negotiate capabilities.
    Looking at the JavaMail API it seems that if I were to call SMTPTransport.helo(String domain) myself without going through the higher-level Transport class that maybe I could work around the issue, but I haven't looked into it enough to know if that's feasible.
    Is anyone familiar with this problem? I'm using JavaMail 1.4.2 on Windows 2003 and Exchange as my SMTP server.
    thanks,
    Eric

    Same problem here (or at least in part). Some .mac folders did no longer show any messages, while they were there and could be seen online and with Thunderbird. After your remark I changed the name of a folder which contained a "´" and now it works. It is really strange because there is another folder with a "¨" in it which does not work (I will test if the name change works with this folder as well in a minute) whilst there is another one with such name which works fine. The update really messed up Mail and in Dutch we just use such characters so Mail without supporting them will be rather useless for me...

  • Problem in sending mail from database with attachment

    Hi All,
    I amd using forms10g,oracle10g
    I am facing a error while running a procedure to send mail from db
    procedure is:
    declare
    ErrorMessage VARCHAR2(4000);
    ErrorStatus NUMBER;
    -- enable SQL*PLUS output;
    --SET SERVEROUTPUT ON
    -- redirect java output into SQL*PLUS buffer;
    --exec dbms_java.set_output(5000);
    BEGIN
    ErrorStatus := SendMailJPkg.SendMail(
    SMTPServerName => '192.168.4.2',
    Sender => '[email protected]',
    Recipient => '[email protected]',
    CcRecipient => '',
    BccRecipient => '',
    Subject => 'hth106: Test JavaMail',
    Body => 'This is the body: Hello, this is a test that spans 2 lines',
    AuthReqdYNNum => 1,
    UserID => 'jagan',
    Password => 'songbirds',
    ErrorMessage => ErrorMessage,
    Attachments => SendMailJPkg.ATTACHMENTS_LIST('C:\oramail\MHTHSO_GEN45.html')
    END;
    while running this procedure i am receiving following error
    "ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.IncompatibleClassChangeError"
    but the same procedure sending mail from all other user in the same database
    I am very myuch confused.i have given the all rights
    below mentioned rights are given .it is working in all other user on the same db except this user "hth106". And all the othere things are compared between working user and this hth106 user every things are same.But i am receiving error when i sending mail with attachment if the mail is sending without attachement it is working fine
    below rights are given to this user
    1.exec dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','read');
    2.exec dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','write');
    3.exec dbms_java.grant_permission('HTH106','java.net.SocketPermission','*','connect');
    4.exec dbms_java.grant_permission('HTH106','java.net.SocketPermission','*','resolve');
    5.exec dbms_java.grant_permission('HTH106','java.io.FilePermission','C:\oramail\*','read');
    exec dbms_java.grant_permission('HTH106','java.io.FilePermission','C:\oramail\*','write');
    6.call dbms_java.grant_permission('HTH106','java.net.SocketPermission','HTHDS01','resolve');
    7.call dbms_java.grant_permission('HTH106','java.util.PropertyPermission','*','read,write');
    7.call dbms_java.grant_permission('HTH106', 'java.io.FilePermission','C:\oramail\*','read');
    please advise me to proceed further
    Thanks in advance
    Thanks ,
    Antony

    With respects to the following:
    The bit you'll have most diffulty with is the attachment, because you can't be sure that
    the directory path specified is one that the database can read from. You can probably
    resolve this by using some java to move the file to a directory which utl_file can see.Another alternative is to specify a location on then database server where all file attachments MUST be copied to and the define and Oracle DIRECTORY (CREATE OR REPLACE DIRECTORY [dir_name] AS '/dir/name/on/files/system';) that references this location. When you attach a file to an email, then you only have to refer to the DIRECTORY for the file location.
    Just my 2 cents on the topic. :-)
    Craig...

  • How to send mail from servlets

    m having troubles sending mail from servlets...
    how do you use the SimpleMailUser object needed in the session?
    a sample code on this would be of great help, thanks!

    <html>
    <body bgcolor="white">
    <font size=5 color="black">
    <%@ page import="javax.servlet.http.HttpUtils" %>
    <%@ page import="java.util.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import= "sun.net.smtp.SmtpClient" %>
    <%
         String from,to,subject,msgbody,serverName;
         try
    from = request.getParameterValues("from")[0];
    to = request.getParameterValues("to")[0];
    subject = request.getParameterValues("subject")[0];
    msgbody = request.getParameterValues("msgbody")[0];
    serverName = request.getParameterValues("server")[0];
         catch (Exception e)          // Generally Speaking, an Error getting one of these
                                       // Values means that it wasnt passed in; inform the user
              out.println("You must call this JSP from this ");
              out.println("<A href=\"FormMail.htm\"> form</A>.<BR>");
              out.flush();return;
    %>
    Hold On A Moment while I try to Send Your Mail... <BR>
    <%
         out.flush();
         // Here are the real guts of the mail sending
         try
         sun.net.smtp.SmtpClient sm = new sun.net.smtp.SmtpClient(serverName);
         sm.from(from);
         sm.to(to);
         PrintStream msg = sm.startMessage();
         msg.println("To: ");     // Note dont use + for Performance
         msg.println(to);
         msg.println("Subject: ");
         msg.println(subject);
         msg.println();
         msg.println(msgbody);
         msg.println("==============");
         msg.print("This mail brought to you by JSP MAIL..from a user at IP ");
         msg.println(request.getRemoteHost());
         sm.closeServer();
         out.println("Your Mail Has Been Sent!");
         catch (Exception e)
              out.println("The mail couldn't be sent, probably because the mailhost wasnt set correctly.<BR> ");
              out.println("The error message I am getting is: ");
              out.println(e.getMessage());
    %>
    <BR>
    <BR>
    Click here to send another!

  • How to send mail from jsp

    hi,
    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin this
    thanks
    regards
    manoj

    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin thisRead
    http://java.sun.com/developer/onlineTraining/JavaMail/
    Rather,
    try this:
    http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html

  • How to send mails from Oracle database

    Hi All,
    I want to send a mail from my oracle database once my store
    procedure runs successfully or fails.
    How can i do this.
    what are the preliminary modules of Oracle which need to be
    active for me to do so.
    If any once can also mention about any links that give
    information about the same it will be very helpful for me.
    Thanks and Regards
    Srinivas Chebolu

    CREATE OR REPLACE PROCEDURE SEND_MAIL_TCP(
    msg_from varchar2 := '[email protected]',
    msg_to varchar2,
    msg_subject varchar2 := 'E-Mail message from your database',
    msg_text varchar2 := '' )
    IS
    c utl_tcp.connection;
    rc integer;
    BEGIN
    c := utl_tcp.open_connection('1.17.0.218', 25); -- open the SMTP
    port 25 on local machine
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'HELO localhost');
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'MAIL FROM: '||msg_from);
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'RCPT TO: '||msg_to);
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'DATA'); -- Start message body
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'Subject: '||msg_subject);
    rc := utl_tcp.write_line(c, '');
    rc := utl_tcp.write_line(c, msg_text);
    rc := utl_tcp.write_line(c, '.'); -- End of message body
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    rc := utl_tcp.write_line(c, 'QUIT');
    dbms_output.put_line(utl_tcp.get_line(c, TRUE));
    utl_tcp.close_connection(c); -- Close the connection
    EXCEPTION
    when others then
    raise_application_error(-20000,'Unable to send e-mail message
    from pl/sql');
    END;
    show errors
    exec send_mail(msg_to =>'[email protected]');
    exec send_mail(msg_to
    =>[email protected]',msg_text=>'Look Yaar, I can send
    mail from plsql');

  • How to send mail from a query

    Hi,
    I met a problem, it was about send mail from a query.
    Scenario: First  make an exception in one query , and if the query trigger the exception , it can send a mail.

    Hi Tino,
    If you are in 7.0, you can use Broadcasting by Exception:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/81/0799413985ad5fe10000000a1550b0/frameset.htm

  • How to send email from OSB with Mail server that requires SSL or STARTTLS

    Hi everyone.
    My leader ask me configuration on OSB to support send email to my company mail server (using https chanel) and customer email (some of them is gmail that require STARTTLS or SSL).
    I've configured OSB as tutorial in that link: http://blogs.oracle.com/christomkins/entry/sending_an_email_from_oracle_s
    But OSB cannot send email from mail account that configured because it cannot login to mail server. I think the reason is secure authentication with SSL or TLS.
    There some problems that similar to mine in this forum but has nobody solved it yet.
    Can you tell me the solution you know? Any suggestion is appreciated.
    Regards
    Cuong Pham

    I know I'll offer you just a workaround and not a real solution, but you can try to start your own (intermediate) SMTP server to communicate with OSB (without SSL). Then you can just relay all the messages to your "real" SMTP server which requires SSL. If you start your intermediate SMTP server on the OSB host (localhost), then this layout could be acceptable even from security point of view.

  • How to send mail from UDM ALERT in Oracle 10 Grid control

    Hi,
    I have created a UDM alert in Grid control for a specific target which is sheduled to run every 15 Minutes.So if the sql query which will run for every 15 min returns any records then it will generate the alerts.*If there is any alerts thrown I should immediately send a mail from UDM .How to do this?*

    10.2 library
    http://download.oracle.com/docs/cd/B16240_01/welcome.html
    Administrator's Guide
    Chapter 4
    *T                                                                                                                                                                                                                                       

  • How to send mail from ABAP code?

    Hi,
    I need to send e-mail from ABAP Code .
    e.g:  If sy-subrc ne 0.
         ( send e-mail to  "[email protected]" )
           endif.
    Please provide me any Function module for this or any code.
    Correct answear will be rewarded my maximum points.
    Thanks & Regards,
    Gaurav.

    Check this code sample
    * Send mail
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test Subject'.
      loop at htmllines.
        mailtxt = htmllines.
        append mailtxt.
      endloop.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_data              = maildata
                document_type              = 'HTM'
                put_in_outbox              = 'X'
           tables
                object_header              = mailtxt
                object_content             = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
      if sy-subrc  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Regards.

  • Send mail from Linux

    Hi.
    My name is Edith, and I have a problem
    I try to send email from a client in LInux, but present this message:
    Error en el m�todo Mail.enviaCorreo()x javax.mail.NoSuchProviderException: No provider for Address type: rfc822
         at javax.mail.Session.getTransport(Session.java:516)
         at javax.mail.Transport.send0(Transport.java:155)
         at javax.mail.Transport.send(Transport.java:81)
         at Pmail.Mail.sendMessage(Mail.java:77)
         at PscannerRF.ScannerJ.enviaCorreo(ScannerJ.java:2956)
         at PscannerRF.ScannerJ.notificaMensaje(ScannerJ.java:2769)
         at PscannerRF.ScannerJ.recepcionGuiasGT(ScannerJ.java:633)
         at PscannerRF.ScannerJ.recepcionGT(ScannerJ.java:366)
         at PscannerRF.ScannerJ.inicio(ScannerJ.java:141)
         at PscannerRF.ScannerJ.main(ScannerJ.java:92)
    Can I help me, please....

    you need to post some code or something. No, the OP has a library problem -- something is missing from the CLASSPATH.
    what's the
    address you're sending to?Obviously, an RFC822 address; e.g. a [email protected]
    M.

  • Send Mail from workflow with a Long URL

    Hello,
    My problem is that when an email gets generated from the workflow in my application, the generated url is quite long. As a result the link is not completely underlined in the email. I know there are limitations discussed in SAP note 363986. But does anybody know a workaround using aliases for the URL? and an example for the same would be great.
    Regards,
    Manoj.
    Message was edited by:
            Manoj Vudathala

    Hello!
    I had the same requirements a while ago and even sent OSS note because customer insisted - even though I informed about the known restrictions.
    Well, SAP replied back that the restrictions are still valid and we tried to use alias and splitting email to multiple container elements but still did not work!
    Using send mail step will simply not work with long URL's!
    But there is a work around if the requirement is business critical - you can create a smartform that has the email text and then pass the URL to the smartform. Smartforms can handle the long URL. You can then trigger a method in your workflow that will send the smartform as email. Hope that gives you an idea!
    Harald

  • Sending mail from plsql with attachement

    Hi Friends,
    i wanted to prepare an excel report and send that by email useing PLSQL .
    i know the inbuild packages UTL_FILE and UTL_SMTP can do this job . But my DBA not allowing me to do this . My DBA adviced me to do this work with in database by inplementing BLOB.
    I have never come accross to this task with in database , ( preparing the excel file and attaching that with mail and send it to users ) ??.
    can some one share tips & sample codes if any ???
    Thank You,
    Raj.

    First thing is Excel is Microsoft Specific and cant be created using UTL_FILE. May be as Excel supports CSV you can create CSV file using UTL_FILE.
    Next BLOB is a datatype like CHAR or VARCHAR2. You can store data in it. Thats all nothing much. With BLOB you can store an excel file. BLOB can't create or send it via EMail.
    So it would be better you talk to your DBA asking him to give more details.
    Thanks,
    Karthick.

  • How to send mail from adobe interactive form without opening the outlook

    Hello all,
    When the end user press the submit button i want it to send the XML data without opening the outlook or other mail application.
    Is there a way to do this?
    I tried javascript codes to send mail with UI = false but it did not work.
    Thank you all in advance,
    Eran

    mailForm
    Parameters: bUI, cTo, [cCc], [cBcc], [cSubject], [cMsgBody]
    Returns: nothing
    This method exports the form data and mails the resulting FDF file as an attachment to all recipients,
    with or without user interaction depending on the value of  bUI.
    If it is set to true then the rest of the parameters are used to seed the compose new message window that is displayed to the user.
    If bUI is set to false, the cTo parameter is required and all others are optional.
    You must use a semicolon u201C;u201D to separate multiple recipients in cTo, cCc, cBcc parameters.
    The length limit for cSubject and cMsgBody is 64k bytes.
    Example:
    /* This will pop up the compose new message window */
    this.mailForm(true);
    /* This will send out the mail with the attached FDF file to fun1 @ fun . com and fun2 @ fun . com */
    this.mailForm(false, "fun1 @ fun . com; fun2 @ fun . com", "", "", "This is the subject", "This is the body of the mail.");
    Note:
    This is a Windows-only feature. In addition, the client machine must have its
    default mail program configured to be MAPI enabled in order to use this method.
    I had to change the code:
    instead of this.mailDoc :
    var myDoc = event.target;
    myDoc.mailDoc(false, "fun1 @ fun . com; fun2 @ fun . com", "", "", "This is the subject", "This is the body of the mail." );       
    But the outlook new message window still opens...
    Any Idea's?
    Eran

Maybe you are looking for