SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Does @recipients have a length limit ?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rmuscarello
Starting Member

USA
7 Posts

Posted - 06/04/2002 :  12:29:02  Show Profile
Is there a limit to the length that @recipients can be? Because when I manually put in enough email address in the @recipients values to exceed 255 characters I get this error:

Server: Msg 17914, Level 18, State 1, Line 0
Unknown recipient: Parameter '@recipients', recipient ' rmuscarello@'

Which is a partial email address when the field gets to a length of 255. Is there a way around this?

setbasedisthetruepath
Used SQL Salesman

USA
992 Posts

Posted - 06/04/2002 :  13:13:00  Show Profile
you might have to send multiple emails.

setBasedIsTheTruepath
<O>

Edited by - setbasedisthetruepath on 06/04/2002 13:13:41
Go to Top of Page

Onamuji
Aged Yak Warrior

USA
504 Posts

Posted - 06/04/2002 :  13:13:45  Show Profile  Visit Onamuji's Homepage  Send Onamuji an AOL message
the only way to get around this is to write an AppendRecipient() function or property that appends the value sent to it to the recipients value .... same for all fields this allows you to get around the 255 character limit imposed by the sp_OA* procedures...

Go to Top of Page

rmuscarello
Starting Member

USA
7 Posts

Posted - 06/04/2002 :  13:17:38  Show Profile
Would you have an example I could look at?
Go to Top of Page

Onamuji
Aged Yak Warrior

USA
504 Posts

Posted - 06/04/2002 :  15:38:14  Show Profile  Visit Onamuji's Homepage  Send Onamuji an AOL message
if you create the vb DLL that interfaces with either MAPI or the CDONTS.NewMail object all you have to do is have:

Private m_strRecipients As String

Public Property Let Recipients(ByVal Value As String)
m_strRecipients = m_strRecipients & Value
End Property


... do that for each property you need to append data to .... you might want to do something like check len(Value) and see if it is zero and use that as a flag to clear the string or something .... figure it out not too complicated...

then you would just loop through your string

@Recipients VARCHAR(8000

SET @Recipients = .... your recipients ....

WHILE LEN(@Recipients) > 0
BEGIN
sp_OASetProperty @objID, 'Recipients', LEFT(@Recipients, 200)
SET @Recipients = RIGHT(@Recipients, LEN(@Recipients) - 200)
END


.... something like that not too accurate on the syntax but you should be able to figure it out...

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000