Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
we wrote PL/SQL code to send Oracle Report in PDF format to outlook as the following code:
procedure U_1ButtonAction is
m_txt varchar2(2500);
emailid varchar2(50);
supp_code varchar2(20);
begin
  for i in (SELECT addr_email,es_supp_code FROM ot_enquiry_supplier,om_address where es_supp_code=addr_code  and 
  es_eh_sys_id=:p_sys_id
   and rtrim(ltrim(addr_email)) is not null)
  loop
  	emailid:=rtrim(ltrim(i.addr_email));
  	supp_code:=rtrim(ltrim(i.es_supp_code));
    srw.run_report('report=opd004_mail destype=mail desname=' ||emailid|| ' desformat=PDF paramform=NO batch=yes SUBJECT=XX DEBUG=YES 
      p_sys_id=' ||:p_sys_id|| ' supp_code1=' ||supp_code|| ''); 	
    m_txt:=rtrim(ltrim(i.addr_email))||',';
  end loop;
  m_txt:=substr(m_txt,1,length(m_txt)-1);    
    EXCEPTION 
    when srw.run_report_failure then 
      srw.message(30, 'Error mailing reports.'); 
      raise srw.program_abort; 
end;


it is working with outlook 2013 without issues , but when we use Office 365 ,we got
REP-4202 and REP-4220 errors .
please any idea.

What I have tried:

procedure U_1ButtonAction is
m_txt varchar2(2500);
emailid varchar2(50);
supp_code varchar2(20);
begin
  for i in (SELECT addr_email,es_supp_code FROM ot_enquiry_supplier,om_address where es_supp_code=addr_code  and 
  es_eh_sys_id=:p_sys_id
   and rtrim(ltrim(addr_email)) is not null)
  loop
  	emailid:=rtrim(ltrim(i.addr_email));
  	supp_code:=rtrim(ltrim(i.es_supp_code));
    srw.run_report('report=opd004_mail destype=mail desname=' ||emailid|| ' desformat=PDF paramform=NO batch=yes SUBJECT=XX DEBUG=YES 
      p_sys_id=' ||:p_sys_id|| ' supp_code1=' ||supp_code|| ''); 	
    m_txt:=rtrim(ltrim(i.addr_email))||',';
  end loop;
  m_txt:=substr(m_txt,1,length(m_txt)-1);    
    EXCEPTION 
    when srw.run_report_failure then 
      srw.message(30, 'Error mailing reports.'); 
      raise srw.program_abort; 
end;
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900