Link to home
Start Free TrialLog in
Avatar of Nana Hemaa
Nana HemaaFlag for United States of America

asked on

mail--database

Trying to use databasemail to send an email to several people.

Declare @CustomerEmailAddressses varchar(max)

Email works when I assign a couple of email addresses to variable @CustomerEmailAddressses.  
It fails when I assign more email addresses... get the error "string not in the form of email address".

Any inputs?
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

You are using a semi-colon separated list correct with plain e-mail addresses like 'an.email@domain.com;my.mail@me.com;way.to.go@mailserver.com"?
http://msdn.microsoft.com/en-us/library/ms190307.aspx
Avatar of Nana Hemaa

ASKER

yes
I am not sure I understand your input.  I know the syntax..everything works fine with about 10 email addresses seperated with semicolon..I need to add about 15 more email addresses and that fails.  I am looking for inputs on why it fails with more addresses
I would check @CustomerEmailAddressses variable after adding all addresses but before executing of sp_send_dbmail procedure to be 100% sure that all adresses are correctly written.
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that was my point exactly.  It is likely failing because you have additional characters in the string.  Sorry I didn't make that clear.  The reason I asked that way is typically the error is from adding an address like 'Joe Smith <joe.smith@somedomain.com>' and ending up with some weird character.
--Can you take the whole emails string and convert it to ASCII text?
--How can I do the conversion?
For instance paste the whole string into a TXT file and make sure the type is truly ANSI not UNICODE or anything else when you save/close it then you can copy again the whole string from that file - not so pretty but it works..