UTL_SMTP inline and attachment issue [message #434562] |
Wed, 09 December 2009 13:47  |
wcannon786
Messages: 2 Registered: December 2009 Location: US
|
Junior Member |
|
|
Read in contents of files and Write text to email body if size is < 10k , otherwise to an attachment. Problem is after writing to an attachment we can't get it to switch to write the next file contents to the message body.
Example; we have 6 files in the table array. The first two files are less than 10k in size so the text from these files get written to the mail body. The third file size is 12k so the text gets written to an attachment. The 4th file is 2k but instead of being written to the email message body it gets appended to the previous attachment. All subsequent files of size < than 10k get appended to the attachment.
|
|
|
|
Re: UTL_SMTP inline and attachment issue [message #434574 is a reply to message #434564] |
Wed, 09 December 2009 15:09  |
wcannon786
Messages: 2 Registered: December 2009 Location: US
|
Junior Member |
|
|
Procedure has no ddl or table access. The only items to substitute are valid smtp server, sender and recipient email addresses. Use any file < 10k bytes for FILENAME1, 12k file for FILENAME2 and a third file < 10k bytes for FILENAME3 so that contents of FILENAME1 is written to the email body, FILENAME2 contents are put in attachment and the contents of FILENAME3 will get appended to the attachment which is the problem.
Code notes:
Line 106- 118: email header text
line 130: loops thru the external files and missing files are simply skipped since exception block does not raise exception.
line 159: Tests to see if file message length > 10k
If TRUE then writes message contents from file to an attachment.
If FALSE then loops through message contents and writes to email body.
line 231: closes the data connection
line 232: quits the data connection
I hope this is enough to test the procedure.
Thank you
|
|
|