6 Replies Latest reply: Feb 26, 2013 12:15 AM by Sachu RSS

    Need to send mail to GMAIL with Attachments

    Sachu
      Hi

      I am able to send mail to Gmail from APEX. Can you please tell how an attachment can be send along with it.

      Regards
      Hisham.A
        • 1. Re: Need to send mail to GMAIL with Attachments
          scott.wesley
          I think you need to start here, then get back to us with any issues.
          http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_mail.htm#CIHDIEJI
          • 2. Re: Need to send mail to GMAIL with Attachments
            VC
            Search the forum before posting a new question because this question was asked a 1000 times in the past

            and

            Always include the following information when asking a question:
            <ul>
            <li>Full APEX version</li>
            <li>Full DB/version/edition/host OS</li>
            <li>Web server architecture (EPG, OHS or APEX listener/host OS)</li>
            <li>Browser(s) and version(s) used</li>
            <li>Theme</li>
            <li>Template(s)</li>
            <li>Region/item type(s)</li>
            </ul>

            You would do that by using APEX_MAIL.ADD_ATTACHMENT API
            • 3. Re: Need to send mail to GMAIL with Attachments
              Sachu
              Hi Scott,

              Thanks for your reply. I didn't use Apex method for sending mail. Since GMAIL is using SMTP I used stunnel for achieving it.

              http://monkeyonoracle.blogspot.ae/2009/11/plsql-and-gmail-or-utlsmtp-with-ssl.html

              with the help of above link im able to send mail from APEX. Now I need to do an attachment. sorry since Im new to APEX little confusion.

              thanks in advance
              • 4. Re: Need to send mail to GMAIL with Attachments
                Sachu
                Dear VC,

                Thanks for the reply. I searched the threads but I could only find thread for sending mails from APEX which is not working with GMAIL. ANy way i found one thread which help to send a mail to gmail from APEX but it didnt mentioned how to do an attachment.

                Thanks
                • 5. Re: Need to send mail to GMAIL with Attachments
                  scott.wesley
                  In that case you asked the question in an ambiguous way.

                  Sending an email to gmail isn't the same as sending an email using gmail as the server.

                  I interpreted sending "to gmail" just like sending anything external to anywhere.

                  Seems like you've got the hard part covered, now just need to read up on using the various email APIs. eg:
                  http://www.orafaq.com/wiki/Send_mail_from_PL/SQL
                  http://www.prowareness.com/blog/how-to-send-emails-with-attachments-from-plsql-stored-procedures/

                  Scott
                  • 6. Re: Need to send mail to GMAIL with Attachments
                    Sachu
                    Hi Scott,

                    Sorry for making the question complicated. I will decribe it in detail.

                    Im using Oracle 11g.

                    I created a application which will accept our gmail address and password (sender) and receipient address(can be anyone like gmail, rediff etc), then a subject and body.

                    when click on send it will send mail to corresponding receipient mail id as saying you have got a message from this gmail account.

                    eg:- sender- my@gmail.com
                    pass - 1234
                    receiver- my@rediffmail.com
                    subject- hi
                    body- test

                    but it will not work if the sender is other than GMAIL

                    eg :- if sender is my@rediffmail.com the message sending will fail because in the stunnel i only specifed smtp for gmail. since i only want gmail as sender that part is ok.
                    now in the same application i need to attach one or multiple file and send along with the message. that part is confusing me. still searching for an option.

                    Sorry for making it ambiguous

                    thanks in advance