3 Replies Latest reply: Feb 12, 2013 10:30 PM by scott.wesley RSS

    email settings

    Eve
      Hi,

      My Application Express Version is 4.2.1.00.08

      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

      **********************************************************
      DECLARE
      l_body CLOB;
      BEGIN
      l_body := 'Thank you for your interest in the APEX_MAIL
      package.'||utl_tcp.crlf||utl_tcp.crlf;
      l_body := l_body ||' Sincerely,'||utl_tcp.crlf;
      l_body := l_body ||' The APEX Dev Team'||utl_tcp.crlf;
      apex_mail.send(
      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');
      END;
      ***********************************************************

      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:

      *¨*********************************************************
      DECLARE
      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);
      BEGIN
      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);
      utl_smtp.Data(v_Mail_Conn,
      '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
      );
      utl_smtp.Quit(v_mail_conn);
      EXCEPTION
      WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
      raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
      END;

      *********************************************************

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

      Please your help.

      Thanks

      Eve
        • 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.

          Scott
          • 2. Re: email settings
            Eve
            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
              http://oraclequirks.blogspot.com.au/2011/09/ora-29024-certificate-validation.html