Skip to Main Content

SQL & PL/SQL

Attaching an html file with utl_smtp package

695278Oct 14 2009
Hi all,

My code uses the demo_mail package to add an html file from the database server as an attachment to an email. This works fine. You open the file, read the lines and write them with write text as an attachment.

* However:*

The html file contains a signature consisting of polylines. Which is a string of coordinates. This string can be 2000 characters long. utl_smtp.write_text somehow splits up that string.

example the signature in the file will be this: <v:polyline id="MMX" points="48,33 50,26 49,22 47,16 45,13 44,11 40,9 34,9 32,12 29,14 29,17 27,21 27,31 28,35 30,39 32,42 35,44 39,45 41,45 47,42 50,40 53,36 55,32 55,30 56,28 56,18 52,19 52,24 53,27 53,31 55,33 58,35 61,36 63,36 66,35 70,33 72,31 75,29 77,27 80,25 82,24 84,28 86,29 89,30 96,30 99,29 101,28 104,28 106,26 107,24 105,24 104,27 104,29 105,31 105,33 107,35 108,38 109,40 113,44 115,45 122,45 124,43 126,42 128,40 130,39 132,37 135,35 139,34 141,33 144,33 144,36 146,39 148,43 149,46 150,48 152,49 153,47 155,41 155,35 154,31 152,28 151,24 149,21 145,18 142,16 140,15 130,15 122,17 116,19 113,21 110,22 104,26 101,29 95,33 93,35 90,37 87,41 79,59 82,60 84,61 112,61 125,59 135,54 138,51 139,49 141,48 143,48 146,47 148,47 150,46 152,46 155,45 157,43 160,42 164,38 166,35 168,33 169,30 171,28 173,24 175,22 179,22 180,24 181,27 181,36 182,39 182,44 181,41 181,38 180,36 180,31 179,28 179,26 178,24 176,22 173,24 173,27 174,31 174,41 173,43 173,46 172,48 172,55 170,58 170,60 171,58 171,54 168,53 169,50 169,48 168,46 164,42 158,42 156,43 150,49 149,51 148,54 147,56 149,55 150,52 149,50 148,52 148,54 146,60 145,62 145,64 149,64 151,63 154,62 156,62 158,61 160,61 162,62 165,63 168,65 173,66 175,64 177,60 175,59 177,63 179,64 182,65 184,63 184,61 186,59 187,57 186,55 183,52 183,50 184,48 184,46 185,43 184,40 184,29 183,25 181,22 182,19 179,13 177,10 175,8 173,7 162,7 160,8 157,9 155,10 150,10 147,11 138,11 134,12 129,12 127,13 123,13 121,14 119,14 116,15 114,15 112,16 110,16 108,17 105,18 93,24 89,25 87,26 85,26 83,27 81,27 79,28 77,28 73,29 66,29 63,28 61,28 58,26 56,25 47,16 45,15 38,15 35,16 33,17 31,19 28,20 26,22 23,24 21,22 21,19 20,17 20,12 21,9 21,7 20,5 17,5 15,7 14,9 14,12 13,16 13,18 15,20 14,22 14,27 15,29 15,34 16,38 17,41 16,44 18,46 22,48 24,48 27,49 33,52 35,56 35,58 36,60 36,62 37,64 39,64 37,64 37,68 39,66 40,64 42,62 43,59 44,57 45,53 47,49 49,43 51,38 53,35 55,29 56,27 57,24 59,21 59,19 60,17 62,14 62,11 63,8 63,6 65,8 65,10 66,12 "></v:polyline>

After write_text it will be: <v:polyline id="MMX" points="48,33 50,26 49,22 47,16 45,13 44,11 40,9 34,9 32,12 29,14 29,17 27,21 27,31 28,35 30,39 32,42 35,44 39,45 41,45 47,42 50,40 53,36 55,32 55,30 56,28 56,18 52,19 52,24 53,27 53,31 55,33 58,35 61,36 63,36 66,35 70,33 72,31 75,29 77,27 80,25 82,24 84,28 86,29 89,30 96,30 99,29 101,28 104,28 106,26 107,24 105,24 104,27 104,29 105,31 105,33 107,35 108,38 109,40 113,44 115,45 122,45 124,43 126,42 128,40 130,39 132,37 135,35 139,34 141,33 144,33 144,36 146,39 148,43 149,46 150,48 152,49 153,47 155,41 155,35 154,31 152,28 151,24 149,21 145,18 142,16 140,15 130,15 122,17 116,19 113,21 110,22 104,26 101,29 95,33 93,35 90,37 87,41 79,59 82,60 84,61 112,61 125,59 135,54 138,51 139,49 141,48 143,48 146,47 148,47 150,46 152,46 155,45 157,43 160,42 164,38 166,35 168,33 169,30 171,28 173,24 175,22 179,22 180,24 181,27 181,36 182,39 182,44 181,41 181,38 180,36 180,31 179,28 179,26 178,2!

4 176,22 173,24 173,27 174,31 174,41 173,43 173,46 172,48 172,55 170,58 170,60 171,58 171,54 168,53 169,50 169,48 168,46 164,42 158,42 156,43 150,49 149,51 148,54 147,56 149,55 150,52 149,50 148,52 148,54 146,60 145,62 145,64 149,64 151,63 154,62 156,62 158,61 160,61 162,62 165,63 168,65 173,66 175,64 177,60 175,59 177,63 179,64 182,65 184,63 184,61 186,59 187,57 186,55 183,52 183,50 184,48 184,46 185,43 184,40 184,29 183,25 181,22 182,19 179,13 177,10 175,8 173,7 162,7 160,8 157,9 155,10 150,10 147,11 138,11 134,12 129,12 127,13 123,13 121,14 119,14 116,15 114,15 112,16 110,16 108,17 105,18 93,24 89,25 87,26 85,26 83,27 81,27 79,28 77,28 73,29 66,29 63,28 61,28 58,26 56,25 47,16 45,15 38,15 35,16 33,17 31,19 28,20 26,22 23,24 21,22 21,19 20,17 20,12 21,9 21,7 20,5 17,5 15,7 14,9 14,12 13,16 13,18 15,20 14,22 14,27 15,29 15,34 16,38 17,41 16,44 18,46 22,48 24,48 27,49 33,52 35,56 35,58 36,60 36,62 37,64 39,64 37,64 37,68 39,66 40,64 42,62 43,59 44,57 45,53 47,49 49,43 51,38!

53,35 55,29 56,27 57,24 59,21 59,19 60,17 62,14 62,11 63,8 63!
,6 65,8
65,10 66,12 "></v:polyline>

The utl_smtp.write_text splits up the textilne in chunks of 990 characters. This results in a different signature.

Are there ways to get around this? Can anyone help with this issue?

Kind Regards,

Maurice Niezen
Post Details
Locked on Nov 11 2009
Added on Oct 14 2009
0 comments
193 views