3 Replies Latest reply on Feb 13, 2013 4:30 AM by Scott Wesley

    email settings


      My Application Express Version is

      I want to configure my apex application with my gmail account in order to send mails.
      In the instance settings I used smtp.gmail.com but it doesn't work.

      SMTP Host Address smtp.gmail.com
      SMTP Host Port 465
      SMTP Authentication Username mymail@gmail.com
      SMTP Authentication Password *********
      Use SSL/TLS Yes
      Default Email From Address mymail@gmail.com

      First I used the following PL SQL anonymous block in a process

      l_body CLOB;
      l_body := 'Thank you for your interest in the APEX_MAIL
      l_body := l_body ||' Sincerely,'||utl_tcp.crlf;
      l_body := l_body ||' The APEX Dev Team'||utl_tcp.crlf;
      p_to => 'mymail@gmail.com', -- change to your email address
      p_from => 'mymail@hotmail.com', -- change to a real senders email address
      p_body => l_body,
      p_subj => 'APEX_MAIL Package - Plain Text message');

      This code doesn't generate any error, but the mail isn't send.

      Second I used a process of send mail type using the following data

      From: mymail@gmail.com
      To: mymail@hotmail.com
      Subject: Test mail
      Body Plain Text: Text mail

      Once again i don't get any error message, but the mail isn't send.

      Finally I used the following code:

      v_From VARCHAR2(80) := 'mymail@gmail.com';
      v_Recipient VARCHAR2(80) := 'mymail@hotmail.com';
      v_Subject VARCHAR2(80) := 'test subject';
      v_Mail_Host VARCHAR2(30) := 'smpt.gmail.com';
      v_Mail_Conn utl_smtp.Connection;
      crlf VARCHAR2(2) := chr(13)||chr(10);
      v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 465);
      utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
      utl_smtp.Mail(v_Mail_Conn, v_From);
      utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
      'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
      'From: ' || v_From || crlf ||
      'Subject: '|| v_Subject || crlf ||
      'To: ' || v_Recipient || crlf ||
      crlf ||
      'some message text'|| crlf ||     -- Message body
      'more message text'|| crlf
      WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
      raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);


      This process take several minutes and the process didn't finish. The page state was Waiting localhost.

      Please your help.


        • 1. Re: email settings
          Scott Wesley
          Log into the INTERNAL workspace and check you email queue. Emails aren't sent immediately - rather added to a queue and processed every 5 minutes or so.

          It's likely the wwv_flow_mail.push_queue process is failing. You should see the errors in the admin workspace manager.

          My e-mail config mojo is not so flash, but I would maybe check ACL settings. I'd be interested to know if this can be done through gmail.

          • 2. Re: email settings
            Thanks Scott

            I review the mail queue and for my two first options to send the mail, i get the same message:

            ORA-29024: Certificate validation failure

            Do I have to create a wallet necesary? How can I do it if I'm using XE?

            Help please
            • 3. Re: email settings
              Scott Wesley
              Beyond my domain, but perhaps this may help