I encountered the strangest bug I have ever seen...
I have a stored procedure that sends an email. The DB status (msdb.dbo.sysmail_mailitems) always sais 'sent' and the send_status is always 1 (success).
However, the mails don't arrive always. I have traced it back to the @subject parameter. It depends on the value of it.
ARRIVES: 'FAIL', 'FAILD', 'FAIEED' 'ECOA', 'eCoA', 'Creation of the eCoA'
DOESN'T ARRIVE: 'FAILED', 'FAILEED' 'Creation of the e-CoA'
It is reproducable. I tried the query outside the stored procedure (running it straight from a query window in SSMS) with the same results for the same subjects.
Query:
EXEC msdb.dbo.sp_send_dbmail
@profile_name ='MyProfile',
@recipients = '[email protected]',
@body = 'Body',
@subject = 'FAILED'
note: I changed email, profile and body. However, those seems to have no influence on the entire problem...
Can someone PLEASE help me? I have eaten my entire desk from frustration...
Thanks guys!!!