بتاريخ: 29 ديسمبر 200718 سنة comment_119365 السلام عليكم ورحمة الله وبركاته يوجد لدي تقرير اريد ان يعمل على ارسال email الى جميع الموظفين الذين ظهروا في التقرير ويحتوي ال email معلومات التقرير .فكيف يمكنني ارسال email من from عند تشغيل تقرير .وشكر لحسن تعاونكم معنا تقديم بلاغ
بتاريخ: 30 ديسمبر 200718 سنة comment_119403 Salamo 3alaikom, 1)You can use the SMTP feature provided by oracle database. First of all, you have to know the ip or name of the exchange server you have at your company. 2) you should provide a sender email(your company email for example). Note: you can put these values as static variables or in a table and select it from there. 3)for the recipient emails, you can put them as a column in the employees table you have. 4) Do a loop to select the name of the employee, his email address and call this email procedure: PROCEDURE SEND_EMAIL( PHOST VARCHAR2, pSender VARCHAR2, pRecipient VARCHAR2, pSubject VARCHAR2, pMessage VARCHAR2) IS mailhost VARCHAR2(256) := PHOST; crlf CONSTANT VARCHAR2(2):= CHR(13) || CHR(10); mesg VARCHAR2(1000); mail_conn utl_smtp.connection; BEGIN mail_conn := utl_smtp.open_connection(mailhost, 25); mesg := 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf || 'From: <'|| pSender ||'>' || crlf || 'Subject: '|| pSubject || crlf || 'To: '||pRecipient || crlf || '' || crlf || pMessage; utl_smtp.helo(mail_conn, mailhost); utl_smtp.mail(mail_conn, pSender); utl_smtp.rcpt(mail_conn, pRecipient); utl_smtp.data(mail_conn, mesg); utl_smtp.quit(mail_conn); EXCEPTION WHEN others then raise_application_error(-20000,sqlerrm); END SEND_EMAIL; --Note that: --PHOST is the host mentioned in point number 1. --Psender is the email mentioned in point number 2. --pREcipient is the email mentioned in point number 3. --psubject is the email subject. --pmessage is the body of the email. --Important note: ask your network admin to open the SMTP service for you on port 25. --Important NOte: sometimes you call this procedure but the email is not sent through your exchange server, this is because of the spam filter. You can ask your network admin to make the spam filter lower to allow oracle to send emails. Good Luck! تقديم بلاغ
بتاريخ: 1 يناير 200818 سنة comment_119529 جميل موضوعك ما شاء الله عليك أخوك في الله : شــــاهين اللهم إني أسألك علما نافعا ورزقا طيبا و عملا متقبلا تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.