Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_sendmail message length

Status
Not open for further replies.

pflakes

Technical User
Jan 27, 2004
31
US
As part of a procedure I've written, I'm querying a table, using the values to assemble a url and sending the url in an email. I've successfully concatenated the string I need for the url and it is being sent in the email.

The problem I'm seeing in the body of the message is that the last 2 characters are getting wrapped to the next line so clicking on the link is failing. In my current example only 77 characters are on the line. The URLs are around 80 characters.

@width seems to only apply to the @query output. Is there any setting that can be used to modify the @message width?
 
direct from BOL


[@width =] width

Is an optional parameter setting the line width of the output text for a query. This parameter is identical to the /w parameter in the isql utility. For queries producing long output rows, use width with attach_results to send the output without line breaks in the middle of output lines. The default width is 80 characters.


so something like

Code:
xp_sendmail @recipients = 'JoeBob@someplace.com',
@message =  'Your Msg',
@subject = 'Your Subject',
@width = 90

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
The width value doesn't seem to apply to the @message -- only the @query value. I've already tried using this with no luck.
 
In relation to this post - How do you concatenate text and SP variables into the email variables?
Ex. (See @message)

xp_sendmail @recipients = 'JoeBob@someplace.com',
@message = 'Batch Number ' & @batchnum,
@subject = 'Your Subject',
@width = 90


Thanks. Slag.
 
I've only worked a little with xp_sendmail but I did find out that variables from 'outside' the xp_sendmail section aren't recognized. You'd have to define @batchnum inside your xp_sendmail begin and end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top