BravehearT-1326
asked on
Sending mail using SP_SEND_DBMAIL stored proc
Hi experts - got a query regarding sp_send_dbmail stored proc and sending to multiple recipients.
I know that multiple recipients MUST be seperated by a ; (semi-colon) however if someone passes multiple address into the recipients parameter and separates them with a , (comma) is there a record to show that the email addresses that did not receive the email because of the ,(comma) used to separate them.
From what I've checked it always reports as successful as the first recipient is valid but cant see any entry for ones after that.
All help appreciated.
I know that multiple recipients MUST be seperated by a ; (semi-colon) however if someone passes multiple address into the recipients parameter and separates them with a , (comma) is there a record to show that the email addresses that did not receive the email because of the ,(comma) used to separate them.
From what I've checked it always reports as successful as the first recipient is valid but cant see any entry for ones after that.
All help appreciated.
I recommend to split @recipients before sending email checking both ',' and ';' separators , then send it one by one for each receipient.
How about you just use REPLACE() in your query on recipients input to change any commas to semicolons?
REPLACE(recips,',',';');
REPLACE(recips,',',';');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found that if you search the sysmail_allitems table you can see if someone has accidently used commas instead of semi-colons in their code. I suppose another way would be to query the email logs from Exchange etc to see if any unreturned / invalid addresses are seen as well.
select * from sysmail_allitems where recipients like '%,%'