Some URGENT probleme with email notification [1]

Hi!
I’ve got a partener who send me an email notification with a URL in the body of the mime message.
(i use Buissiness Connector 4.6 SR3 with lotus mail server 6.0.10)

First, i’ve use a save piplinetofile fonction for retreive the body but now (i don’t know why!) it doesnt work anymore!
I wish use the mime fonctions of webMethods but i realy dont understand HOW TO GET MY mime message in the pipeline?
The help guide say that “is depend of the method i use” but i don’t have any!
Is it some Java programming or a simple use that i missed?
Thank for your help…

I’ve got a similar problem retriving file attachs.
I solve it using a java program. You must point
the inbound mail to this program.

I’m not a java programer but it works !!

Feel free to change it for your convenience:

good luck,

Sebasti�Miranda
Barcelona, Spain

/******************************************************

  •     (C) Sebasti�Miranda
    
  •   IMPORTS java.io.*
    
  •   EXTENDS com.wm.app.b2b.server.ServerAPI
    

********************************************************/
String subject = null;
String from = null;
String contenttype = null;
String protocol = null;
String filename = null;
String sentdate = null;
String recvdate = null;
boolean mail = false;
String destinatario = null;
String body = null;
IData salida = IDataFactory.create();
String contenido = null ;
ByteArrayInputStream is = null;
byte contenidoBytes = null;

IDataHashCursor idhc = pipeline.getHashCursor();
if (idhc.first(“transport”)) {
IData transport = (IData)idhc.getValue();
idhc.destroy();
idhc = transport.getHashCursor();

if ( idhc.first("protocol" )) {
    protocol = (String)idhc.getValue();
    if ( protocol.equals("email") ) {
        if ( idhc.first("email")) {
            IData email = (IData)idhc.getValue();
            mail = true;
            idhc.destroy();
            idhc = email.getHashCursor();
        if ( idhc.first("subject") ) {
            subject = (String)idhc.getValue();
            }
        if ( idhc.first("content") ) {
            is = (ByteArrayInputStream) idhc.getValue();
        }
        if ( idhc.first("filename") ) {
            filename = (String)idhc.getValue();
            }
        if ( idhc.first("from") ) {
            from = (String[])idhc.getValue();
            }

    if ( idhc.first("sentdate") ) {
            sentdate = (String)idhc.getValue();
            }

    idhc.destroy();
    }
}
}

}

/******************************************************

  • EXTRAIGO el contenido de los ficheros
    ******************************************************/
    try{
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    int lenZ = 0;
    byte tmpBt = new byte[2048];
    while (lenZ != -1)
    {
    try{
    lenZ = is.read(tmpBt);
    }
    catch(EOFException e){
    lenZ = -1;
    }
    if (lenZ > 0) os.write(tmpBt, 0, lenZ);
    }
    contenido = os.toString();
    contenidoBytes = os.toByteArray();
    is.close();
    os.close();
    }
    // PROBLEMAS ???
    catch (IOException e){
    sendMail(“SMiranda@pastasgallo.es”, “EnviosEDI@pastasgallo.es”, subject,
    " Problemas con los envios de Dhul: " + e );
    }

/******************************************************

  • Send Mail for test !!

if (mail){
destinatario = “SMiranda@pastasgallo.es”;
subject = “Pruebas Tratamiento Mails: " + subject;
body = " TEST: \n Enviado el: " + sentdate
+”\n De: " + from[0]
+“\n Archivo: " + filename
+”\n Contenido: \n"+ contenido;
sendMail(destinatario, “EnviosEDI@pastasgallo.es”, subject, body);
}
******************************************************/
// Data output
IDataCursor pipelineCursor_2 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_2, “Contenido”, contenido );
IDataUtil.put( pipelineCursor_2, “contentBytes”, contenidoBytes );
IDataUtil.put( pipelineCursor_2, “filename”, filename );
IDataUtil.put( pipelineCursor_2, “from”, from[0] );
IDataUtil.put( pipelineCursor_2, “subject”, subject );
pipelineCursor_2.destroy();