• Jueves 2 de Mayo de 2024, 07:27

Autor Tema:  Envio Email  (Leído 1791 veces)

Dino

  • Nuevo Miembro
  • *
  • Mensajes: 5
    • Ver Perfil
Envio Email
« en: Jueves 4 de Mayo de 2006, 14:59 »
0
Tengo un problema al intentar enviar un correo electrónico desde oracle forms, utilizo el siguiente procedimiento, el resultado es que no da ningún error pero no evía el correo.
procedure send( Recp       IN varchar2,
                Subject    IN varchar2,
                Text       IN varchar2,
--                Binary        IN varchar2,
                Attch1      IN varchar2
               )is
Begin

/* Add a new object message1 to the outbox */
    session_outbox := ole2.get_obj_property(session,'outbox');
    session_outbox_messages := ole2.get_obj_property(session_outbox,'messages');
    message1 := ole2.invoke_obj(session_outbox_messages,'Add');
   ole2.set_property(message1,'subject',Subject);
--   ole2.set_property(message1,'Binary',Binary);
   ole2.set_property(message1,'text',Text);

/* Add a recipient object to the message1.Recipients collection */
    msg_recp := ole2.get_obj_property(message1,'Recipients');
    recipient := ole2.invoke_obj(msg_recp,'add') ;

   ole2.set_property(recipient,'name',Recp);
   ole2.set_property(recipient,'type',1);
   ole2.invoke(recipient,'resolve');

/* Add an attachment object to the message1.Attachments collection */
    msg_attch := ole2.get_obj_property(message1,'Attachments');
    attachment1 := ole2.invoke_obj(msg_attch,'add') ;
   ole2.set_property(attachment1,'name',Attch1);
   ole2.set_property(attachment1,'position',0);
   ole2.set_property(attachment1,'type',1);      /* 1 => MAPI File Data */

--   ole2.invoke(attachment,'resolve');  

  ole2.set_property(attachment1,'source',Attch1);

/* Read the attachment from the file */
    args := ole2.create_arglist;
    ole2.add_arg(args,Attch1);

    ole2.invoke(attachment1,'ReadFromFile',args);
    ole2.destroy_arglist(args);

    ole2.invoke(message1,'Save');

  args := ole2.create_arglist;
  ole2.add_arg(args,1);   /* 1 => save copy */
  ole2.add_arg(args,0);   /* 0 => no dialog */
--  ole2.add_arg(args,1);   /* 1 => dialog */


/* Send the message without any dialog box, saving a copy in the Outbox */

   ole2.invoke(message1,'Send',args);

  ole2.destroy_arglist(args);
--   mensaje('Se ha enviado mensaje al responsable de enviar la cinta al banco');

End;
¿Puede alguien echarme una mano?
Gracias.