UTL_SMTP Encoding Issue [message #445084] |
Thu, 25 February 2010 13:24 |
MattWeiler
Messages: 9 Registered: February 2010 Location: Canada
|
Junior Member |
|
|
I've written a PL/SQL package for emailing.
The issue that I'm having is that the final encoded stream has extra characters ( exclamation mark + new line + space ) "randomly" scattered throughout it.
If the email is plain-text, it's not a big deal, it just looks messy and unprofessional.
However, when sending HTML formatted emails, those extra characters can break HTML tag logic and thus, visually, hide some data/text.
This package allows for the creation of nicely formatted HTML alert emails which have a common look-and-feel.
However, when I view the email in my email viewer (MS Outlook 2007), there are additional characters inserted in the email source. However, if I user DBMS_OUTPUT.PUT_LINE( ... ) to view the dynamically created HTML code, created at run-time, it's clean.
I had previously created a similar process in UNIX Shell Script and a 2nd in webMethods.
The webMethods version also had some issues with the encoding (we had to use base64 encoding to fix that), however using base64 didn't fix the issue that I'm having in ORACLE.
I've included my code as an attachment
Any help would be greatly appreciated.
************************************
To reproduce my issues:
BEGIN
WM_EMAIL_HANDLER.SEND_ALERT( in_processName => 'Test Maker',
in_msg => 'Something gone done broke. You''d better fix it.',
in_subject_msg => 'Something Broke',
in_threatLevel => 5,
in_to => WM_EMAIL_HANDLER.ARRAY( 'you@yourHost.com' ),
in_from => 'oracle.DEV@yourHost.com',
in_fromName => 'Oracle Database Account <oracle.DEV@yourHost.com>',
in_smtp_hostname => 'yourMailHost',
in_smtp_portnum => 'yourMailHostPort' );
END;
/
************************************
Extra Info:
- Oracle 10g running on Solaris UNIX
- MS Exchange Server is our MAIL server
- We're using mail host port 25
|
|
|