الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ارسال ايميل من خلا ال pl/sql

مغلق
بدأه shawahneh في 15 أكتوبر 2006 · 4 رد · 3,735 مشاهدة · في قسم لغةالاجرائات Pl/sql
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

تمكنت من كتابة procedure لإرسال ايميل باستخدام ال utl_smtp ولكن ظهرت لدي مشكلة في ان اللغة العربية تظهر على شكل ؟؟؟؟؟؟؟؟ عندما استقبل الايميل ، كيف يمكنني حل هذه المشكلة؟

#2

أين البروسيجر وسأوافيك إن شاء الله

أانا كلي تحت أمرك........ خذ فرحي وهات همك ....... خذ ضحكي وهات دمعك ......خذ عمري بس اعطيني حبك

jakwar_al_it@hotmail.com

#3

ياريت فعلا تفيدنا بالPROCEDURE ده

وجزاك الله عنا خيرا

#4

تأكد من الـ Nls_Lang لديك .

يجب ان تكون مثلاً :

american_america.ar8mswin1256
#5

بالنسبة للإجراء الخاص بإرسال الإيميل :

REM
REM example.sql - A PL/SQL code example to demonstrate how to use the UTL_SMTP
REM package to send emails in ASCII and non-ASCII character sets, emails
REM with text or binary attachments. This example uses the demo_mail helper
REM package that utilizes the UTL_SMTP package to send emails via SMTP.
REM  
REM Note: this example relies on the UTL_ENCODE PL/SQL package in Oracle 9i.
REM For Oracle 8i users, please use example8i instead.

REM Send an email in text to two recipients

BEGIN
  demo_mail.mail(
	sender	 => 'Me <me@some-company.com>',
	recipients => 'Someone <someone@some-company.com>, ' ||
				  '"Another one" <another-one@some-company.com>',
	subject	=> 'Test',
	message	=> 'Hi! This is a test.');
END;
/

REM Send an email in HTML

DECLARE
  conn utl_smtp.connection;
BEGIN
  conn := demo_mail.begin_mail(
	sender	 => 'Me <me@some-company.com>',
	recipients => 'Someone <someone@some-company.com>',
	subject	=> 'HTML E-mail Test',
	mime_type  => 'text/html');

  demo_mail.write_text(
	conn	=> conn,
	message => '<h1>Hi! This is a <i>test</i>.</h1>');

  demo_mail.end_mail( conn => conn );

END;
/

REM Send an email with 2 attachments.

DECLARE
  conn	  utl_smtp.connection;
  req	   utl_http.req;  
  resp	  utl_http.resp;
  data	  RAW(200);
BEGIN
  conn := demo_mail.begin_mail(
	sender	 => 'Me <me@some-company.com>',
	recipients => 'Someone <someone@some-company.com>',
	subject	=> 'Attachment Test',
	mime_type  => demo_mail.MULTIPART_MIME_TYPE);

  demo_mail.attach_text(
	conn	  => conn,
	data	  => '<h1>Hi! This is a test.</h1>',
	mime_type => 'text/html');

  demo_mail.begin_attachment(
	conn		 => conn,
	mime_type	=> 'image/gif',
	inline	   => TRUE,
	filename	 => 'image.gif',
	transfer_enc => 'base64');

  -- In writing Base-64 encoded text following the MIME format below,
  -- the MIME format requires that a long piece of data must be splitted
  -- into multiple lines and each line of encoded data cannot exceed
  -- 80 characters, including the new-line characters. Also, when
  -- splitting the original data into pieces, the length of each chunk
  -- of data before encoding must be a multiple of 3, except for the
  -- last chunk. The constant demo_mail.MAX_BASE64_LINE_WIDTH
  -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
  -- of data before encoding.

  req := utl_http.begin_request('http://www.some-company.com/image.gif');
  resp := utl_http.get_response(req);

  BEGIN
	LOOP
	  utl_http.read_raw(resp, data, demo_mail.MAX_BASE64_LINE_WIDTH);
	  demo_mail.write_raw(
		conn	=> conn,
		message => utl_encode.base64_encode(data));
	END LOOP;
  EXCEPTION
	WHEN utl_http.end_of_body THEN
	  utl_http.end_response(resp);
  END;
  demo_mail.end_attachment( conn => conn );

  demo_mail.attach_text(
	conn	  => conn,
	data	  => '<h1>This is a HTML report.</h1>',
	mime_type => 'text/html',
	inline	=> FALSE,
	filename  => 'report.htm',
	last	  => TRUE);

  demo_mail.end_mail( conn => conn );

END;
/

REM Send an email in Chinese (big5). This needs to be executed in a database
REM with ZHT16BIG5 character set.

DECLARE
  conn utl_smtp.connection;
BEGIN
  conn := demo_mail.begin_mail(
	sender	 => 'Me <me@some-company.com>',
	recipients => 'Someone <someone@some-company.com>',
	subject	=> 'Chinese Email Test',
	mime_type  => 'text/plain; charset=big5');

  demo_mail.write_mb_text(
	conn	=> conn,
	message => 'Chinese email example - ¤¤¤ه¹q¤l¶l¥َ¨ز¤l' || utl_tcp.CRLF);

  demo_mail.end_mail( conn => conn );
END;
/

أو مراجعة الرابط للإستزادة

وبالتوفيق ..

هذا الموضوع مغلق.

مواضيع مشابهة