Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: double line spacing in smtp

Re: double line spacing in smtp

From: Chuck <skilover_nospam_at_softhome.net>
Date: Mon, 26 Sep 2005 11:01:13 -0400
Message-ID: <1127742649.32eaf0032a71c494ee439c453b810706@bubbanews>


MikeS wrote:
> Thanks, I'll add some more details and hopefully you can help after you
> come back from your hols.
>
> On oracle 9.2.0.6 on windows2000 server.
>
> Used demo_mail package from
> http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt
>
>
> DECLARE
> conn utl_smtp.connection;
> req utl_http.req;
> resp utl_http.resp;
> data RAW(32767);
> v_file_handle utl_file.file_type;
> v_file_name VARCHAR2(60) := 'wor020_665126.lis';
> i PLS_INTEGER;
> len PLS_INTEGER;
> flen NUMBER;
> bsize NUMBER;
> ex BOOLEAN;
> BEGIN
> conn := demo_mail.begin_mail(
> sender => 'Me <me_at_some-company.com>',
> recipients => 'Mike <mike_at_home.co.uk>',
> 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');
>
> utl_file.fgetattr('ORABIN', v_file_name, ex, flen, bsize);
> v_file_handle := utl_file.fopen('ORABIN', v_file_name, 'r' );
> utl_file.get_raw(v_file_handle, data, flen);
> utl_file.fclose(v_file_handle);
>
> demo_mail.attach_base64(conn => conn,
> data => data,
> mime_type => 'application/octet-stream',
> inline => TRUE,
> filename => v_file_name,
> last => TRUE);
> demo_mail.end_mail( conn => conn );
>
> END;
>

I don't mean to beat a dead horse, but this could be done in about 4 lines with mail/mailx in the o/s. Code below is for korn shell but could easily be modified for any other shell.

mailx -s 'Attachment Test' mike_at_home.co.uk <<! Hi! This is a test.
$(uuencode wor020_665126.lis wor020_665126.lis) !

Of course this does assume you are using unix. If windows, you could download blat. It's not much harder to use than mailx.

just my .02

-- 
To reply by email remove "_nospam"
Received on Mon Sep 26 2005 - 10:01:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US