Skip to main content
Solved

Command_SYS.Mail(


ADNAN
Sidekick
Forum|alt.badge.img+8

 

Our company moved to office 365 and the mail port and protocol changed. I adjusted the mails sent from the events tab in IFS. I cannot run mails sent from PLSQL. Where can I change the settings?

 

With the following settings, mails sent from the events tab work.

 

 

 

 

Working mail is not working for the example procedure below.

PROCEDURE SISTEM_BILGISI
IS

parameter_attr_    VARCHAR2(2000);
      result_key_        NUMBER;
      report_attr_       VARCHAR2(2000);
      msg_               VARCHAR2(32000); 
      print_job_id_      NUMBER;
      attr_              VARCHAR2(4000);
      date_              DATE;
      attach_            VARCHAR2(2000);
      text_              VARCHAR2(32766);
      subject_           VARCHAR2(2000);
      deger_           VARCHAR2(2000);
      
   BEGIN
       IFSAPP.Log_SYS.Init_Debug_Session_('en');
  

   
          Command_SYS.Mail(
            from_user_name_ => 'IFSAPP',
            to_user_name_ => 'ayilmaz@sefine.com.tr',
          ---  cc_ => 'ayilmaz@sefine.com.tr',
            text_ => 'vvvvvvv' ,
            attach_ => attach_,
            subject_ => 'aaaaaa' );
            
   General_SYS.Init_Method(Sfn_Bt_Tcr_To_Ask_Util_API.lu_name_, 'Sfn_Bt_Tcr_To_Ask_Util_API', 'SISTEM_BILGISI');
END SISTEM_BILGISI;

I am waiting for your valuable information.

Best answer by CallumW

Use the other one. The one you are using is expecting a table for the attachments - you are sending it text.

COMMAND_SYS.Mail(sender_      => 'IFS Applications!',
                 from_        => 'ayilmaz@xx.com.tr',
                 to_list_     => 'ayilmaz@xx.com.tr',
                 cc_list_     => '',
                 bcc_list_    => '',
                 subject_     => 'Subject',
                 text_        => 'Text',
                 attach_      => '',
                 rowkey_      => '',
                 mail_sender_ => 'MUT_MAIL_SENDER');

 

View original
Did this topic help you find an answer to your question?

13 replies

paul harland
Superhero (Employee)
Forum|alt.badge.img+24

Hi @ADNAN 

Is there an error appearing when executing the code?

If not, then check the IFS page Application Messages / Notifications queue.  You’ll probably see a failure message saying that the mail sender is not configured correctly.


ADNAN
Sidekick
Forum|alt.badge.img+8
  • Author
  • Sidekick
  • 53 replies
  • October 7, 2020

 

hi

@paul harland 

The problem is there I can send an e-mail from the e-mail I choose with Default Instance, but I cannot send an e-mail with an e-mail address that I did not choose as Default in PL SQL.

 

 

 

but the mail goes with defaul chosen.

 

 


paul harland
Superhero (Employee)
Forum|alt.badge.img+24

I’m not sure but I think I understand the question...

If using an IFS Event Action, choose the mail sender here (Apps 10)

If doing it through the API, you can submit the mail sender as a parameter here in Command_sys.mail

 


pwlm
Hero (Partner)
Forum|alt.badge.img+11
  • Hero (Partner)
  • 75 replies
  • October 8, 2020

Hi Adnan ( @ADNAN ),

Have you considered using the UTL_SMTP Oracle package instead of Command_Sys.Mail?

https://oracle-base.com/articles/misc/email-from-oracle-plsql

https://www.morganslibrary.org/reference/pkgs/utl_smtp.html

Useful resources above.

I find it much more powerful and suits my use cases perfectly.

Cheers,

Pete


ADNAN
Sidekick
Forum|alt.badge.img+8
  • Author
  • Sidekick
  • 53 replies
  • October 9, 2020

hi @paul harland 

 

no sender parameters :(

 

PROCEDURE SISTEM_BILGISI
IS

parameter_attr_    VARCHAR2(2000);
      result_key_        NUMBER;
      report_attr_       VARCHAR2(2000);
      msg_               VARCHAR2(32000); 
      print_job_id_      NUMBER;
      attr_              VARCHAR2(4000);
      date_              DATE;
      attach_            VARCHAR2(2000);
      text_              VARCHAR2(32766);
      subject_           VARCHAR2(2000);
      deger_           VARCHAR2(2000);
      
   BEGIN
       IFSAPP.Log_SYS.Init_Debug_Session_('en');
  

   
          Command_SYS.Mail(
            from_user_name_ => 'AYILMAZ',
            to_user_name_ => 'ayilmaz@xxx.com.tr',
          ---  cc_ => 'ayilmaz@sefine.com.tr',
            text_ => 'vvvvvvv' ,
            attach_ => attach_,
            subject_ => 'aaaaaa' );
            
   General_SYS.Init_Method(Sfn_Bt_Tcr_To_Ask_Util_API.lu_name_, 'Sfn_Bt_Tcr_To_Ask_Util_API', 'SISTEM_BILGISI');
END SISTEM_BILGISI;


CallumW
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • 128 replies
  • October 15, 2020

Press these in blue

 

The other two options for COMMAND_SYS.MAIL have mail_sender

 


ADNAN
Sidekick
Forum|alt.badge.img+8
  • Author
  • Sidekick
  • 53 replies
  • October 15, 2020

 hi @CallumW 

it says the variable number is wrong.

 

 

it says the variable number is wrong.


CallumW
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • 128 replies
  • October 15, 2020

Your Mail Sender is called MUT_MAIL_SENDER not ayilmaz@XX.com.tr


ADNAN
Sidekick
Forum|alt.badge.img+8
  • Author
  • Sidekick
  • 53 replies
  • October 15, 2020

@CallumW

The problem I'm having is not the parameter value.

The number of error variable types the procedure gave me is wrong.

 


CallumW
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • 128 replies
  • Answer
  • October 15, 2020

Use the other one. The one you are using is expecting a table for the attachments - you are sending it text.

COMMAND_SYS.Mail(sender_      => 'IFS Applications!',
                 from_        => 'ayilmaz@xx.com.tr',
                 to_list_     => 'ayilmaz@xx.com.tr',
                 cc_list_     => '',
                 bcc_list_    => '',
                 subject_     => 'Subject',
                 text_        => 'Text',
                 attach_      => '',
                 rowkey_      => '',
                 mail_sender_ => 'MUT_MAIL_SENDER');

 


ADNAN
Sidekick
Forum|alt.badge.img+8
  • Author
  • Sidekick
  • 53 replies
  • October 16, 2020

@CallumW  thank you so much.


Forum|alt.badge.img+1
  • Do Gooder
  • 2 replies
  • February 2, 2021

Hey, I tried to directly pass a file path into attach_  but it does not work, should I do something before this to make sure I’m able to send the mail including the attachment. Thanks in advance 


Forum|alt.badge.img+1
  • Do Gooder
  • 2 replies
  • February 2, 2021

 I’m seeing this error, when I add the local file path in attach_ in command_sys method, any idea why i’m seeing this error? 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings