[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

mail--database

Posted on 2011-05-13
8
Medium Priority
?
278 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:Nana Hemaa
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 35755058
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
0
 

Author Comment

by:Nana Hemaa
ID: 35755063
yes
0
 

Author Comment

by:Nana Hemaa
ID: 35755090
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
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 14

Expert Comment

by:Daniel_PL
ID: 35755131
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.
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 35755268
I think you may have some NON varchar string(s) in the list of email and to be 100% you have only ASCII not some UTF-8 for instance you must be cautios with copy/paste email addreses (and any other strings for that matter) in Windows. Can you take the whole emails string and convert it to ASCII text?
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 35755356
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.
0
 

Author Comment

by:Nana Hemaa
ID: 35755411
--Can you take the whole emails string and convert it to ASCII text?
--How can I do the conversion?
0
 
LVL 40

Expert Comment

by:lcohan
ID: 35756209
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..
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question