SMTP error from remote mail server after initial connection:

Hello folks. I having some serious issues sending email to clients with .mac accounts. I keep on getting the following error. Can someone help? I have replaced email address names with "Blank@...) for obvious reasons.
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
[email protected]
SMTP error from remote mail server after initial connection:
host smtp-mx1.mac.com [17.148.20.64]: 452 try later:
retry timeout exceeded
------ This is a copy of the message, including all the headers. ------
Return-path: <[email protected]>
Received: from ip72-207-229-240.br.br.cox.net ([72.207.229.240] helo=[192.168.0.102])
by srv3.purenrg.com with esmtp (Exim 4.68)
(envelope-from <[email protected]>)
id 1JFeOb-0001FZ-5F
for [email protected]; Thu, 17 Jan 2008 18:43:41 -0500
Message-Id: <[email protected]>
From: "[email protected]" <[email protected]>
To: Cindy Barnes <[email protected]>
Content-Type: multipart/alternative; boundary=Apple-Mail-3--1032078955
Mime-Version: 1.0 (Apple Message framework v915)
Subject: invoice 520 is overdue
Date: Thu, 17 Jan 2008 17:43:40 -0600
X-Mailer: Apple Mail (2.915)
X-PopBeforeSMTPSenders: [email protected]{
--Apple-Mail-3--1032078955
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Content-Transfer-Encoding: 7bit

I'm sure someone will give more detail, but it looks like the server blocked your address because it thinks it's a spam source.  If you're not spamming, then it might be someone on the same network spamming, or malware on your computer doing it.  Or it could just be a mistake.  try calling whoever runs your mail server and see if they can give you more information.

Similar Messages

  • SMTP error from remote mail server 522 IP REPUTATI...

    I have a hosting business, and one of my clients on BTinternet, using BT Mail is now having mail bounce back to sender when forwarded from her domain mailbox.
    Here is an example of the bounced errors -
    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:
    [email protected]
    (ultimately generated from [email protected])
    host mx.bt.lon5.cpcloud.co.uk [65.20.0.49]
    SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=3749:
    522 IP REPUTATION BAD (please check for IP address listing on reputation services)
     I've changed the actual addresses above. The server the mail is being forwarded from has an IP address 138.128.161.22
    It seems that BT believes that the  server the mail is forwarded from is blacklisted. However, I am unable to discover any blacklist issue for this server. As you can see from the MXToolbox enquiry, there are no blacklists reported -
    http://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a138.128.161.22&run=toolpage
    Can anybody from BT tell me who I need to contact to find out why they are not accepting mail from my server? I'm not having a problem with mail forwarded to any other ISP, and it seems to be just BT that is rejecting the mail.
    I hope someone can advise.
    Myles

    Hi @magicalwonders
    Have a look at http://bt.custhelp.com/app/answers/detail/a_id/47055/kw/postmaster/c/346,6592/session/L3RpbWUvMTQyOD...
    Also have a look at this post: https://community.bt.com/t5/Email/BT-Email-bounce-backs/m-p/1477146/highlight/true#M34004
    Openwave messaging (was Critical Path) is the company who designed and implemented the BT consumer email system and platform may require you to correctly set up a SPF record.
    Also have a look at:
    https://community.bt.com/t5/Email/BTinternet-rejecting-all-our-emails/m-p/1480775/highlight/true#M34...
    jac_95 | BT.com Help Site | BT Service Status
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Try a Search
    See if someone in the community had the same problem and how they got it resolved.

  • SMTP error from remote mail service

    I am receiving a error that states"SMTP error from remote mail service" This is my work e-mail that is a out look e-mail service--but was put on my laptop in mozilla. If I test send e-mails to my gmail, aol and the work e-mail the work e-mail goes through (on the mozilla) but I get the error report for the gmail and aol test.

    ''Matt [[#answer-672468|said]]''
    <blockquote>
    what is the complete error message please.
    </blockquote>
    Hi Matt--thank you for reaching out to assist--here is the full error message I receive when I attempt to send emails--
    SMTP error from remote mail server after end of data:
    host p3nlsmtpcp-v01.prod.phx3.gdg [72.167.191.78]:
    552 5.2.0 bT641p03m3RZ6FL01 :: CPANEL :: Message rejected for spam or virus content ::
    Please include this entire message when contacting support ::
    v=2.1 cv=Yecz5mhf c=1 sm=1 tr=0 p=dXr4a0FlAAAA:8 a=9P+wmFvZGoNcfX5LD2dIAQ==:117 a=9P+wmFvZGoNcfX5LD2dIAQ==:17 a=TZb1taSUAAAA:8 a=xSRs65CQCjkA:10 a=IkcTkHD0fZMA:10 a=o1OHuDzbAAAA:8 a=YNv0rlydsVwA:10 a=AK46IGkTethYI5b8t1AA:9 a=QEXdDO2ut3YA:10 a=RBqHpAr1aNgA:10 a=SZlYXZE0WA8A:10 a=POQKUN4lQn8A:10 a=5LQJebhDX5EA:10 a=lWHhIcKi20EA:10 a=AP_QpuyW5RgA:10 a=_ZmE1jEfA50A:10 a=fVc70mvjwYYA:10 a=BfRt8DTvoOQA:10 ::
    100.00

  • How to retrieve mails from a Mail Server ? PLEASE REPLY IF YOU KNOW !

    Hello,
    I am trying to retrieve mail from a mail server using the example from JGuru. The command line is as follows:
    java GetMessageExample mail.wlfdle1.on.home.com (Mail Server Name) <username> <password>
    I should be prompted to read the messages in your INBOX. Enter YES to see the message content.
    0: [email protected] Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah
    1: [email protected] No Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah Blah
    I do not get any error or any output.
    Any Clue or any idea how I can get some result ??
    Response will be appreciated.
    Thanks.

    This is the sample program from jguru. After executing the following command (replacing the mail server, username, and password):
    java GetMessageExample POP.Server username password
    You'll be prompted to read the messages in your INBOX. Enter YES to see the message content.
    0: [email protected] Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah
    1: [email protected] No Thanks.
    Do you want to read message? [YES to read/QUIT to end]
    YES
    Blah Blah Blah Blah
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class GetMessageExample {
    public static void main (String args[]) throws Exception {
    String host = args[0];
    String username = args[1];
    String password = args[2];
    // Create empty properties
    Properties props = new Properties();
    // Get session
    Session session = Session.getDefaultInstance(props, null);
    // Get the store
    Store store = session.getStore("pop3");
    // Connect to store
    store.connect(host, username, password);
    // Get folder
    Folder folder = store.getFolder("Inbox");
    // Open read-only
    folder.open(Folder.READ_ONLY);
    BufferedReader reader = new BufferedReader (
    new InputStreamReader(System.in));
    // Get directory
    Message message[] = folder.getMessages();
    System.out.println(folder.getMessages());
    for (int i=0, n=message.length; i<n; i++) {
    // Display from field and subject
    System.out.println(i + ": " + message.getFrom()[0]
    + "\t" + message[i].getSubject());
    System.out.println("Do you want to read message? [YES to read/QUIT to end]");
    String line = reader.readLine();
    if ("YES".equals(line)) {
    // Display message content
    System.out.println(message[i].getContent());
    } else if ("QUIT".equals(line)) {
    break;
    // Close connection
    folder.close(false);
    store.close();
    Please help me on this.
    thanks.

  • Exception when fetch message from pop3 mail server

    below exception occur whenever i fetched message from pop3 mail server. Its occur for perticular message. so i catched javax.mail.MessagingException but this is not working and rest of the messages skips.
    plz help me , its urgent.
    javax.mail.MessagingException: error loading POP3 headers;
      nested exception is:
            java.io.IOException: Unexpected response: ------=_NextPart_000_01B9_01C8
    A1AB.148BE090
            at com.sun.mail.pop3.POP3Message.loadHeaders(POP3Message.java:467)
            at com.sun.mail.pop3.POP3Message.getHeader(POP3Message.java:275)
            at javax.mail.internet.MimeMessage.getSubject(MimeMessage.java:717)
            at fetch1.<init>(fetch1.java:92)
            at fetch1.main(fetch1.java:185)
    Caused by: java.io.IOException: Unexpected response: ------=_NextPart_000_01B9_0
    1C8A1AB.148BE090
            at com.sun.mail.pop3.Protocol.simpleCommand(Protocol.java:361)
            at com.sun.mail.pop3.Protocol.multilineCommand(Protocol.java:373)
            at com.sun.mail.pop3.Protocol.top(Protocol.java:271)
            at com.sun.mail.pop3.POP3Message.loadHeaders(POP3Message.java:451)
            ... 4 more
    Press any key to continue...Code :-
    import java.util.*;
    import java.io.*;
    import javax.mail.*;
    import javax.mail.Flags.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class fetch3
         fetch3()
              try
                   // Setup properties
                   Properties props = System.getProperties();
                   props.put("mail.pop3.host","myMailserver ip");     
                   // Setup authentication, get session
                   Authenticator auth = new PopupAuthenticator();
                   Session session = Session.getDefaultInstance(props, auth);
                   // Get the store
                   Store store = session.getStore("pop3");
                   store.connect();
                   // Get folder
                   Folder folder = store.getFolder("INBOX");
                   folder.open(Folder.READ_WRITE);
                   Flags flag = folder.getPermanentFlags();
                   // Get directory
                   Message message[] = folder.getMessages();
                   // Display from (only first) and subject of messages
                   for (int i=0, n=message.length; i<n; i++)
                   System.out.println ("------------------------------------------------------");
                        System.out.println(" From     : "+message.getFrom()[0]);
                        System.out.println(" To : "+message[i].getAllRecipients()[0]+" "+message[i].getAllRecipients().length);
                        System.out.println(" Replyto : "+message[i].getReplyTo()[0]);
                        System.out.println(" Subject : "+message[i].getSubject());
                        System.out.println ("type "+message[i].getContent());
                        Part messagePart=message[i];
                        Object content=messagePart.getContent();
                        // -- or its first body part if it is a multipart message --
                        if (content instanceof Multipart)
                             messagePart=((Multipart)content).getBodyPart(0);
                        //     System.out.println("[ Multipart Message ]");
                        // -- Get the content type --
                        String contentType=messagePart.getContentType();
                        // -- If the content is plain text, we can print it --
                        System.out.println("CONTENT:"+contentType);
                        if (contentType.startsWith("text/plain") || contentType.startsWith("text/html") || contentType.startsWith("multipart/alternative"))
                             InputStream is = messagePart.getInputStream();
                             BufferedReader reader
                             =new BufferedReader(new InputStreamReader(is));
                             String thisLine=reader.readLine();
                             while (thisLine!=null)
                                  System.out.println(thisLine);
                                  thisLine=reader.readLine();
                        System.out.println ("------------------------------------------------------");
                   // Close connection
                   folder.close(false);
                   store.close();
              catch(Exception e)
                   e.printStackTrace();
         public static void main(String s[])
              new fetch3();
    Regards 
    Sagar
    Edited by: sagar_birari on 23 Apr, 2008 1:18 PM
    Edited by: sagar_birari on 23 Apr, 2008 4:30 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    it shows below output
    C:\>java -Dmail.debug=true fetch1
    DEBUG: JavaMail version 1.4ea
    DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_06\lib\java
    mail.providers (The system cannot find the file specified)
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.providers
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax
    .mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsyste
    ms, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com
    .sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLSt
    ore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsyst
    ems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.su
    n.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=jav
    ax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc],
    com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP
    3Store,Sun Microsystems, Inc]}
    DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.
    sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STOR
    E,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Prov
    ider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc],
    pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems
    , Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun
    Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.S
    MTPTransport,Sun Microsystems, Inc]}
    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.address.map
    DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_06\lib\java
    mail.address.map (The system cannot find the file specified)
    DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.
    POP3Store,Sun Microsystems, Inc]
    DEBUG POP3: connecting to host "pop3_server_ip", port 110, isSSL false
    S: +OK Hello there.
    C: USER [email protected]
    S: +OK Password required.
    C: PASS mypass
    S: +OK logged in.
    DEBUG: setDebug: JavaMail version 1.4ea
    C: STAT
    S: +OK 16 143077
    C: NOOP
    S: +OK Yup.Edited by: sagar_birari on 24 Apr, 2008 1:16 PM
    Edited by: sagar_birari on 24 Apr, 2008 1:18 PM

  • Error: The e-mail server could not be reached when the system was trying to

    Dear All,
    I've configured the Mail Transport in Portal successfully with SMTP as MS Exchange Server and Third-party Mailing servers. But due to some licensing issues a new MS Exchange mail server have been setup replacing the existing ones.
    And when i configure the Mail Transport in the system i get the below message on the eMail Window:
    "Error: The e-mail server could not be reached when the system was trying to send the message!
    javax.mail.MessaginException: 530 5.7.1 Client ws not authenticated
    I've configured (all the steps) the same way as i used to before and restarted the server as well! Please let me know the issue to be resolved, the telnet to the mailserver is also successful. I've try'd searching SDN, didn't find the exact solution... any notes on this?
    Thanks,
    MS

    Hi,
    It will depend on your infrastructure, I am not sure and have limited knowledge on netowrks, but in my current landscape both the system were in same domain, but  still i had to maintain proxy configuration.
    Since it giving authentication error, it feel it could be proxy error.
    Please refer below links which talks about same error :
    http://java.sun.com/products/javamail/FAQ.html#smtpauth
    Or else i think it is issue with port.
    Regards,
    Jigar Oza
    Edited by: jigar oza on Jul 6, 2010 12:43 PM

  • Creating accounts and receiving email from a mail server

    Hi,
    I'm wanting to create a web application that creates a new email account for a user when they sign-up on my website. My application will process any email that is sent to that email address and extract parts of the email to store in a database.
    I think I can use JavaMail to poll the email accounts for new emails which will then be parsed and inserted into my database but I don't know how to programmatically create the email account for each user. I'm looking at using either sendmail or postfix as my mail server and this is on either *nix or os x.
    Any advice/pointers to Java APIs would be appreciated. If there's nothing available in Java that can do this kind of thing I'd love to hear about other solutions people know of or think might work :)
    Thanks!
    - E

    Hi there!
    Do the following
    message.setFlag(Flags.Flag.DELETED,true);
    folder.close(true);
    store.close();
    these 3 statements will delete email from the mail server.
    get back to me after u try this.
    ciao
    vivek

  • Error interpreting the mail server response in Messenger Express

    Background:
    Migrated from Sparc running iMS 6.0 to Linux running iMS 6.3 (from CommSuite 5)
    Problem:
    Some users, some times experience problems using Messenger Express. They receive the following error in their web browsers: Error interpreting the mail server response.
    Attempted solutions:
    1) 120230-20 -- no change in behavior
    2) reconstruct -r -- didn't fix the issue
    3) Support case with Sun -- tech seems to be guessing as a solution and not trying to troubleshoot the issue (growing frustration -- those I am here)
    Data gathered:
    I turned on the telemetry logging for this user and in the end of the imap session, I see:
    0.002>)F OK Completed
    <30.747<C UNSELECT
    0.003>C OK CompletedNETWORK ERROR: Connection reset by peer
    LOGOUT <username> 2007/7/17 8:46:07 - 2007/7/17 8:48:15
    This seems to come and go (working sometimes and not working others) for a few (5 or so) users, though, I haven't found any correlation between the users or how they differ from anyone else. Checking email via POP or IMAP works fine (just not via Messenger express).
    What else can I look at?

    Hi,
    Shane...thank you so much. <refrains from bashing Sun
    Support at this point>I should point out that myself and Jay are also Sun Support (we answer forum questions in our spare time).
    We have a valid support contract and the tech has
    never indicated that he has done any research into
    this issue -- he only keeps throwing out ideas based
    off of nothing. I asked him what he knows about the
    mentioned bug. awaiting response.I couldn't comment on this without looking at the case notes.
    <pushing my luck> Is there anything I can provide you
    which would help diagnose this? Based off of the
    logs (snips i provided u before), it does indeed
    seem to be related to the email
    headers...specifcially headers SpamAssassin added.What's the Sun support case #? Have you provided the full logs (rather then just snips) to the support engineer?
    Thanks again -- you're doing a great job.All part of the service.
    Regards,
    Shane.

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • Our company have just upgraded to iOS 6 and the majority of the users are now receiving the following error 'Cannot Get Mail – Server error. Contact your server administrator' when accessing ms exchange this never happened on iOS 5 can anyone help

    Our company have just upgraded to iOS 6 and the majority of the users are now receiving the following error 'Cannot Get Mail – Server error. Contact your server administrator' when accessing ms exchange this never happened on iOS 5 can anyone help

    Have you tried deleting the account and re-adding it on the phone?
    What version of Exchange server are you running?

  • Rename a Data Integrator server after initial installation

    Is it possible to rename the Data Integrator server after initial installation?

    The easiest thing to do is running the server manager before the migration and remove the repository assoziation or the entire jobserver. Same with the management console.
    Then move the server.
    And recreate the jobserver and webadmin entry.
    In case it is too late for the first step, simply truncate AL_MACHINE_INFO table deleting all jobserver/webadmin links and then resync those.

  • Just trying out my new mac but email won't load, error says "The mail server denied access to the account because an administrator or other mail client was using it when Mail tried to log in. Try again later." A little lock is beside the email inbox

    Just trying out my new mac but email won't load, error says "The mail server denied access to the account because an administrator or other mail client was using it when Mail tried to log in. Try again later." A little lock is beside the email inbox account, no password prompted and account is online and enabled... Thoughts?

    Have you tried clicking on the lock to see it it will then ask for a passwored.  Otherwise, try reblooting.

  • Is there a setting for mail that will allow me to delete emails on the Iphone without being deleted from the mail server? I have Yahoo mail.

    Is there a setting in Iphone mail that will allow me delete emails on the Iphone without deleting the emil from the mail server? I want to be able to download the email to other devices.  I am using Yahoo mail.

    I did not mean actually editing in the PDF, but just copying the text out of the PDF and pasting into indd... or Word.. .or anything. Regardless, just wondering if there was a way to avoid those line breaks.

  • If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    You certainly can.
    Be aware that the emails you move to local storage ("on my Mac") will be the only copies that remain.

  • How to send e-mail with an attachment from remote database server.???

    Hi All,
    I have tried the simple mail sending and with the attachment using UTL_SMTP. But the problem is , it is sending the mail with attachment of the file name i give, it takes and creates that file and sends as attachment not from the actual file location. I am trying to attach the file which i stored in remote database server.
    The following code I tried. But not worked for attachment
    DECLARE
       v_From       VARCHAR2(80) := '[email protected]';
       v_Recipient  VARCHAR2(80) := '[email protected]';
       v_Subject    VARCHAR2(80) := 'test subject';
       v_Mail_Host  VARCHAR2(30) := 'pop3.somedomain.com';
       v_Mail_Conn  utl_smtp.Connection;
       crlf         VARCHAR2(2)  := chr(13)||chr(10);
    BEGIN
      v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
      utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
      utl_smtp.Mail(v_Mail_Conn, v_From);
      utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
      utl_smtp.Data(v_Mail_Conn,
        'Date: '   || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
        'From: '   || v_From || crlf ||
        'Subject: '|| v_Subject || crlf ||
        'To: '     || v_Recipient || crlf ||
        'MIME-Version: 1.0'|| crlf ||     -- Use MIME mail standard
        'Content-Type: multipart/mixed;'|| crlf ||
        ' boundary="-----SECBOUND"'|| crlf ||
        crlf ||
        '-------SECBOUND'|| crlf ||
        'Content-Type: text/html;'|| crlf ||
        'Content-Transfer_Encoding: 7bit'|| crlf ||
        crlf ||
        'some message text'|| crlf ||     -- Message body
        'more message text'|| crlf ||
        crlf ||
        '-------SECBOUND'|| crlf ||
        'Content-Type: text/html;'|| crlf ||
        ' name="Fund Authorization report"'|| crlf ||
        'Content-Transfer_Encoding: 8bit'|| crlf ||
        'Content-Disposition: attachment;'|| crlf ||
        ' filename="/usr/tmp/Test.html"'|| crlf ||
        crlf ||
        'HTML Attachment'|| crlf ||     -- Content of attachment
        crlf ||
        '-------SECBOUND--'               -- End MIME mail
      utl_smtp.Quit(v_mail_conn);
    EXCEPTION
      WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
        raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;How can I attach a file which is stored in database server and send it in a mail.
    Please someone help me in this.
    Thanks,
    Alaka.

    Try this code
    Regards Salim.
    CREATE OR REPLACE TRIGGER EmailOnServerErr AFTER SERVERERROR ON DATABASE
    DECLARE
       mail_conn       UTL_SMTP.connection;
       crlf            VARCHAR2(2) := chr(13)||chr(10);
       msg             VARCHAR2(32760);
       sid_name        VARCHAR2(16);
       bdump_dest      VARCHAR2(128);
       smtp_relay      VARCHAR2(32) := 'MyMailRelay';
       recipient_address  VARCHAR2(64) := '[email protected]';
       sender_address     VARCHAR2(64) := '[email protected]';
       mail_port       NUMBER := 25;
       log_file_handle UTL_FILE.FILE_TYPE;
       log_file_dir    VARCHAR2(256) := 'ERR_LOG_DIR';
       log_file_name   VARCHAR2(256) := 'OracleErrors.log';
       maxlinesize     NUMBER := 32767;
       session_rec     sys.v_$session%ROWTYPE;
       audit_rec       sys.dba_audit_trail%ROWTYPE;
       auditing        BOOLEAN;
       LinesOfSQL      BINARY_INTEGER;
       offending_sql   DBMS_STANDARD.ora_name_list_t;
       CURSOR bdump_cur IS
          SELECT TRIM(value)
          FROM v$parameter
          WHERE name = 'background_dump_dest'
       CURSOR sid_cur IS
          SELECT TRIM(instance_name)
          FROM v$instance
       CURSOR session_cur IS
          SELECT s.*
          FROM v$session s
          WHERE s.sid = dbms_support.mysid
       CURSOR audit_trail_cur(AUDSID IN NUMBER) IS
          SELECT *
          FROM dba_audit_trail
          WHERE sessionid = AUDSID
    BEGIN
       IF (USER = 'SYSTEM' OR USER = 'SYS') THEN
          -- Ignore this error
          NULL;
       ELSIF IS_SERVERERROR (1034) THEN
          -- Ignore this error
          NULL;
       ELSE
          -- get the sid
          OPEN sid_cur;
          FETCH sid_cur INTO sid_name;
          CLOSE sid_cur;
          -- get the location of the alert log
          OPEN bdump_cur;
          FETCH bdump_cur INTO bdump_dest;
          CLOSE bdump_cur;
          -- get the session information
          OPEN session_cur;
          FETCH session_cur INTO session_rec;
          CLOSE session_cur;
          -- get the audit_trail information if it exists
          OPEN audit_trail_cur(session_rec.audsid);
          FETCH audit_trail_cur INTO audit_rec;
          auditing := audit_trail_cur%FOUND;
          CLOSE audit_trail_cur;
          IF session_rec.program = 'MyProgram.exe' THEN
             NULL;  -- ignore actions from MyProgram - that's where I do maintenance
          ELSE
             -- compose the message
             msg := 'Subject: Oracle error '||' on '||sid_name||crlf;
             msg := msg||'To: '||recipient_address||crlf;
             msg := msg||'For more information see the alert log file located at:'||crlf;
             msg := msg||bdump_dest||'/alert_'||sid_name||'.log'||crlf;
             msg := msg||'or the error log file: $'||log_file_dir||'/'||log_file_name||crlf;
             msg := msg||'Error Time='||TO_CHAR(SYSDATE,'DD-Mon-YYYY HH24:MI:SS')||crlf;
             msg := msg||DBMS_UTILITY.FORMAT_CALL_STACK||crlf;
             LinesOfSQL := sql_txt(offending_sql);
             msg := msg||'Offending SQL is:'||crlf;
             FOR loop_counter IN offending_sql.FIRST..offending_sql.LAST
             LOOP
                msg := msg||offending_sql(loop_counter);
             END LOOP;
             msg := msg||crlf||'----- PL/SQL Error Stack -----'||crlf;
             msg := msg||DBMS_UTILITY.FORMAT_ERROR_STACK||crlf;
             msg := msg||'V$SESSION.SADDR='   ||session_rec.saddr   ||crlf;
             msg := msg||'V$SESSION.SID='     ||session_rec.sid     ||crlf;
             msg := msg||'V$SESSION.SERIAL#=' ||session_rec.serial# ||crlf;
             msg := msg||'V$SESSION.AUDSID='  ||session_rec.audsid  ||crlf;
             msg := msg||'V$SESSION.PADDR='   ||session_rec.paddr   ||crlf;
             msg := msg||'V$SESSION.USER#='   ||session_rec.user#   ||crlf;
             msg := msg||'V$SESSION.USERNAME='||session_rec.username||crlf;
             msg := msg||'V$SESSION.COMMAND=' ||session_rec.command ||crlf;
             msg := msg||'V$SESSION.OWNERID=' ||session_rec.ownerid ||crlf;
             msg := msg||'V$SESSION.TADDR='   ||NVL(session_rec.taddr   ,'Null')||crlf;
             msg := msg||'V$SESSION.LOCKWAIT='||NVL(session_rec.lockwait,'Null')||crlf;
             msg := msg||'V$SESSION.STATUS='  ||NVL(session_rec.status  ,'Null')||crlf;
             msg := msg||'V$SESSION.SERVER='  ||NVL(session_rec.server  ,'Null')||crlf;
             msg := msg||'V$SESSION.SCHEMA#=' ||session_rec.schema#||crlf;
             msg := msg||'V$SESSION.SCHEMANAME=' ||NVL(session_rec.schemaname,'Null')||crlf;
             msg := msg||'V$SESSION.OSUSER='     ||NVL(session_rec.osuser    ,'Null')||crlf;
             msg := msg||'V$SESSION.PROCESS='    ||NVL(session_rec.process   ,'Null')||crlf;
             msg := msg||'V$SESSION.MACHINE='    ||NVL(session_rec.machine   ,'Null')||crlf;
             msg := msg||'V$SESSION.TERMINAL='   ||NVL(session_rec.terminal  ,'Null')||crlf;
             msg := msg||'V$SESSION.PROGRAM='    ||NVL(session_rec.program   ,'Null')||crlf;
             msg := msg||'V$SESSION.TYPE='       ||NVL(session_rec.type      ,'Null')||crlf;
             msg := msg||'V$SESSION.SQL_ADDRESS='    ||session_rec.sql_address  ||crlf;
             msg := msg||'V$SESSION.SQL_HASH_VALUE=' ||NVL(TO_CHAR(session_rec.sql_hash_value) ,'Null')||crlf;
             msg := msg||'V$SESSION.PREV_SQL_ADDR='  ||session_rec.prev_sql_addr||crlf;
             msg := msg||'V$SESSION.PREV_HASH_VALUE='||NVL(TO_CHAR(session_rec.prev_hash_value),'Null')||crlf;
             msg := msg||'V$SESSION.MODULE='     ||NVL(session_rec.module              ,'Null')||crlf;
             msg := msg||'V$SESSION.MODULE_HASH='||NVL(TO_CHAR(session_rec.module_hash),'Null')||crlf;
             msg := msg||'V$SESSION.ACTION='     ||NVL(session_rec.action              ,'Null')||crlf;
             msg := msg||'V$SESSION.ACTION_HASH='||NVL(TO_CHAR(session_rec.action_hash),'Null')||crlf;
             msg := msg||'V$SESSION.CLIENT_INFO='||NVL(session_rec.client_info         ,'Null')||crlf;
             msg := msg||'V$SESSION.FIXED_TABLE_SEQUENCE='||NVL(TO_CHAR(session_rec.fixed_table_sequence),'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_OBJ#='  ||NVL(TO_CHAR(session_rec.row_wait_obj#)  ,'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_FILE#=' ||NVL(TO_CHAR(session_rec.row_wait_file#) ,'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_BLOCK#='||NVL(TO_CHAR(session_rec.row_wait_block#),'Null')||crlf;
             msg := msg||'V$SESSION.ROW_WAIT_ROW#='  ||NVL(TO_CHAR(session_rec.row_wait_row#)  ,'Null')||crlf;
             msg := msg||'V$SESSION.LOGON_TIME='     ||NVL(TO_CHAR(session_rec.logon_time,'DD-Mon-YYYY HH24:MI:SS'),'Null')||crlf;
             msg := msg||'V$SESSION.LAST_CALL_ET='   ||NVL(TO_CHAR(session_rec.last_call_et)   ,'Null')||crlf;
             msg := msg||'V$SESSION.PDML_ENABLED='   ||NVL(session_rec.pdml_enabled   ,'Null')||crlf;
             msg := msg||'V$SESSION.FAILOVER_TYPE='  ||NVL(session_rec.failover_type  ,'Null')||crlf;
             msg := msg||'V$SESSION.FAILOVER_METHOD='||NVL(session_rec.failover_method,'Null')||crlf;
             msg := msg||'V$SESSION.FAILED_OVER='    ||NVL(session_rec.failed_over    ,'Null')||crlf;
             msg := msg||'V$SESSION.RESOURCE_CONSUMER_GROUP='||NVL(session_rec.resource_consumer_group,'Null')||crlf;
             msg := msg||'V$SESSION.PDML_STATUS='    ||NVL(session_rec.pdml_status    ,'Null')||crlf;
             msg := msg||'V$SESSION.PDDL_STATUS='    ||NVL(session_rec.pddl_status    ,'Null')||crlf;
             msg := msg||'V$SESSION.PQ_STATUS='      ||NVL(session_rec.pq_status      ,'Null')||crlf;
             IF auditing THEN
                msg := msg||'DBA_AUDIT_TRAIL.OS_USERNAME='  ||NVL(audit_rec.os_username,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.USERNAME='     ||NVL(audit_rec.username   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.USERHOST='     ||NVL(audit_rec.userhost   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.TERMINAL='     ||NVL(audit_rec.terminal   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.TIMESTAMP='    ||TO_CHAR(audit_rec.timestamp,'DD-Mon-YYYY HH24:MI:SS')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OWNER='        ||NVL(audit_rec.owner      ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OBJ_NAME='     ||NVL(audit_rec.obj_name   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ACTION='       ||audit_rec.action   ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ACTION_NAME='  ||NVL(audit_rec.action_name   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.NEW_OWNER='    ||NVL(audit_rec.new_owner     ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.NEW_NAME='     ||NVL(audit_rec.new_name      ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.OBJ_PRIVILEGE='||NVL(audit_rec.obj_privilege ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SYS_PRIVILEGE='||NVL(audit_rec.sys_privilege ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ADMIN_OPTION=' ||NVL(audit_rec.admin_option  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.GRANTEE='      ||NVL(audit_rec.grantee       ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.AUDIT_OPTION=' ||NVL(audit_rec.audit_option  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SES_ACTIONS='  ||NVL(audit_rec.ses_actions   ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_TIME='  ||NVL(TO_CHAR(audit_rec.logoff_time)  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LREAD=' ||NVL(TO_CHAR(audit_rec.logoff_lread) ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_PREAD=' ||NVL(TO_CHAR(audit_rec.logoff_pread) ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LWRITE='||NVL(TO_CHAR(audit_rec.logoff_lwrite),'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_DLOCK=' ||NVL(audit_rec.logoff_dlock  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.COMMENT_TEXT=' ||NVL(audit_rec.comment_text  ,'Null')||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.SESSIONID='    ||audit_rec.sessionid   ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.ENTRYID='      ||audit_rec.entryid     ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.STATEMENTID='  ||audit_rec.statementid ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.RETURNCODE='   ||audit_rec.returncode  ||crlf;
                msg := msg||'DBA_AUDIT_TRAIL.PRIV_USED='    ||NVL(audit_rec.priv_used,'Null')||crlf;
             END IF;
             msg := msg||'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'||crlf||crlf;
             -- write the message to the error log file
             log_file_handle := UTL_FILE.FOPEN (log_file_dir, log_file_name, 'A',maxlinesize);
             UTL_FILE.PUT_LINE(log_file_handle,msg);
             UTL_FILE.FCLOSE(log_file_handle);
             -- send the message by Email
             mail_conn := UTL_SMTP.open_connection(smtp_relay, mail_port);
             UTL_SMTP.HELO(mail_conn, smtp_relay);
             UTL_SMTP.MAIL(mail_conn, sender_address);
             UTL_SMTP.RCPT(mail_conn, recipient_address);
             UTL_SMTP.DATA(mail_conn, msg);
             UTL_SMTP.QUIT(mail_conn);
          END IF; -- client_program = MyProgram.exe
       END IF;
    END;
    /

Maybe you are looking for