Jafar Kofahi
Jafar Kofahi

Reputation: 763

UTL_MAIL.Send inconsistent behavior

Based on some parameters the PL/SQL code builds a query and executes it, then sends an email based on the results. The email templates (HTML) are also stored in a table and before sending an email I update the template with the results then send the email. I use UTL_MAIL.SEND to send emails from the backend (Oracle).

Inconsistency issue: Currently I have two reports, both use the same query but with different where conditions, when the email is sent one of them is received correctly, while the other is received as follows:

=?WINDOWS-1252?Q?days?=
X-Priority: 3
Content-Type: multipart/mixed;
 boundary="------------4D8C24=_23F7E4A13B2357B3"

This is a multi-part message in MIME format.
--------------4D8C24=_23F7E4A13B2357B3
Content-Type: text/html
Content-Transfer-Encoding: 7bit

<html><head></head><body ><form id="form1"  enctype="multipart/form-data">
         <div style='font-family:Arial'><p>This is to inform you that ....etc

The Email header is messed up for the second one, I googled and I couldnt find anything about this issue, it is driving me nuts! I even tried copying the email template from the one that works into this one and it still gave me this rubbish.

Any ideas to why this is happening, or why the email is messed up like this?

Upvotes: 2

Views: 248

Answers (1)

Jafar Kofahi
Jafar Kofahi

Reputation: 763

For future readers

The problem wasn't with the body it was with the subject, if my subject line has more than 40 characters it fails!! and it was working fine before so maybe something changed on the server side, I dont have a clue!

In conclusion: if you encounter such a problem try shortening your subject and body text and see if that would solve your problem, it did for me!

Upvotes: 1

Related Questions