الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ارسال بريد باستخدام Utl_Smtp

Featured Replies

بتاريخ:

السلام عليكم ..... لقد قمت بعمل form بمجرد الانتهاء يقوم ارسال بريد الالكترونى ولكن المشكلة انى اريد ان اضيف file ك attachment وهذا الfile
موجود بالفعل على الجهاز ...... لقد بحثت كثير ولكن لم اجد سوى عمل file مع الايميل ويقوم بكتابة text فقط .........

----------------------------------------------------------------------------------------------------

DECLARE

v_From VARCHAR2(80) := '[email protected]';

v_Recipient VARCHAR2(80) := '[email protected]';

v_Subject VARCHAR2(80) := 'test subject';

v_Mail_Host VARCHAR2(30) := '10.10.103.103';

v_Mail_Conn utl_smtp.Connection;

crlf VARCHAR2(2) := chr(13)||chr(10);

BEGIN

v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);



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 ||



'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard

'Content-Type: multipart/mixed;'|| crlf ||

' boundary="-----SECBOUND"'|| crlf ||

crlf ||



'-------SECBOUND'|| crlf ||

'Content-Type: text/plain;'|| crlf ||

'Content-Transfer_Encoding: 7bit'|| crlf ||

crlf ||

'some message text'|| crlf || -- Message body

'more message text'|| crlf ||

crlf ||



'-------SECBOUND'|| crlf ||

'Content-Type: text/plain;'|| crlf ||

' name="excel.csv"'|| crlf ||

'Content-Transfer_Encoding: 8bit'|| crlf ||

'Content-Disposition: attachment;'|| crlf ||

' filename="excel.csv"'|| crlf ||

crlf ||

'CSV,file,attachement'|| crlf || -- Content of attachment

crlf ||



'-------SECBOUND--' -- End MIME mail

);



utl_smtp.Quit(v_mail_conn);

EXCEPTION

WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then null;

--raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);

END;

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.