1 Reply Latest reply: Dec 25, 2013 6:47 AM by Andreas Weiden RSS

    Send Mail

    Moazam Shareef

      Guys,

       

      I'm sending mail through forms 10g, which working fine but i cannot send it to multiple recepients i tried a lot but failed to achive any one help me how can i send to multiple guys.

       

      PROCEDURE SEND_MAIL_REQ IS
        mailhost VARCHAR2(30) := 'mail.xyz.com';
        mail_conn utl_smtp.connection;
        mesg VARCHAR2( 4000 );
        crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
      BEGIN
        mail_conn := utl_smtp.open_connection(mailhost, 25);
        utl_smtp.helo(mail_conn, mailhost);
        utl_smtp.mail(mail_conn, :MN_EMP_VAC.EMP_EMAIL);
        utl_smtp.rcpt(mail_conn, :MN_EMP_VAC.MNGR_EMAIL);
        mesg:= 'Date: '||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' )|| crlf ||
        'From:'||:MN_EMP_VAC.EMP_EMAIL|| crlf ||
         'Subject:'||'Vacation Notification'||' '||:MN_EMP_VAC.VAC_ID||' '||'Name:'||' '||:MN_EMP_VAC.NAME || crlf ||
         'To: '||:MN_EMP_VAC.MNGR_EMAIL||','||:MN_EMP_VAC.EMP_EMAIL|| crlf ||
         'Cc: '||:MN_EMP_VAC.EMP_EMAIL||crlf ||
        '' || crlf ||':MAIL_BODY';
        utl_smtp.data( mail_conn, mesg );
        utl_smtp.quit( mail_conn );
      
      EXCEPTION
        WHEN OTHERS THEN
        Message ('Failed to send mail due to the following error: ' || sqlerrm);
      
      
      END;
      


      To:||MN_EMP_VAC.MNGR_EMAIL||','||:MN_EMP_VAC.EMP_EMAIL

      for single person i can send easily but for multiple i cannot.

       

      here i tried to concatenate the values with ', ;  and SPACE but fail to achieve is anything wrong the the above code?

      i'm using oracle 10g forms 10g

      Regards

       

      h