We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

sp_send_dbmail Limitations

Medium Priority
2,433 Views
Last Modified: 2012-06-22
I get the following message with I execute the code belowl. How can I extend the 128 limit. I also get this massage when the @query is longer that 128!

Msg 103, Level 15, State 4, Line 2
The identifier that starts with 'Jon_Peters@Pall.com; Steve_Jordan@Pall.com; Brenda_Robinson@Pall.com;
Pat_Travis@Pall.com; Greg_McIntosh@Pall.com; David_Conn@P' is too long. Maximum length is 128.

exec msdb.dbo.sp_send_dbmail @profile_name="insqlmail",
@recipients = "bill_Peters@all.com; Jon_Jordan@all.com; Brenda_Ball@all.com;
Nat_avis@all.com; George_McIntosh@all.com; Bill_Conn@all.com;
TAkin@all.com; bill_davison@all.com",
@subject="Test Email",
@body="Let me(Ralph Hill) know if you get this"

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
very very strange....the @recipients is a varchar(max) field, so it definetly should allow more than 128 characters.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
try this instead:

exec msdb.dbo.sp_send_dbmail @profile_name='insqlmail',
@recipients = 'bill_Peters@all.com; Jon_Jordan@all.com; Brenda_Ball@all.com;
Nat_avis@all.com; George_McIntosh@all.com; Bill_Conn@all.com;
TAkin@all.com; bill_davison@all.com',
@subject='Test Email',
@body='Let me(Ralph Hill) know if you get this'

CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
you had double quotes rather than single quotes

Author

Commented:
try this instead:

exec msdb.dbo.sp_send_dbmail @profile_name='insqlmail',
@recipients = 'bill_Peters@all.com; Jon_Jordan@all.com; Brenda_Ball@all.com;
Nat_avis@all.com; George_McIntosh@all.com; Bill_Conn@all.com;
TAkin@all.com; bill_davison@all.com',
@subject='Test Email',
@body='Let me(Ralph Hill) know if you get this'

When I did this the emails did not go out!
CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
at least you didn't get the error...you may have something configured wrong on your smtp server or your db mail setup.
Topic Advisor, Page Editor
CERTIFIED EXPERT
Distinguished Expert 2018
Commented:
Agree... The recipients list is of type varchar(max).

exec msdb.dbo.sp_send_dbmail
@profile_name='insqlmail',
@recipients = 'bill_Peters@all.com; Jon_Jordan@all.com; Brenda_Ball@all.com; Nat_avis@all.com; George_McIntosh@all.com; Bill_Conn@all.com;TAkin@all.com; bill_davison@all.com',
@subject='Test Email',
@body='Let me(Ralph Hill) know if you get this'
CERTIFIED EXPERT
Awarded 2008
Awarded 2008
Commented:
yep...if you're not getting delivery, probably should submit a new question.
Mark WillsTopic Advisor, Page Editor
CERTIFIED EXPERT
Distinguished Expert 2018
Commented:
Have a look at :

select * from msdb..sysmail_sentitems
select * from msdb..sysmail_faileditems


Have they all failed? is there anything in there?  have you gone into mail settings and tried a test mail ?  These are all things we can help answer in the new question - be sure to add in the "related question" link so we get notified...

Author

Commented:
Sorry, everyone, These were all great suggestions. I tried everything posted but nothing worked. We're doing without this functionality.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.