Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Thursday, March 29, 2012

Create an email link within the report...

Hello...

I have a column of data on my report that contains an email address. Is it possible to format this so that the person running the report can just click on the link and have that action launch their email program...like Outlook?

thanks for any help

- will

Hi Will - Yes, you can use expressions to build "mailto:" URLs, and set these for the "jump to" value in the navigation tab for the field properties.

|||

Thanks for the reply and info...this worked great.

- will

Tuesday, March 27, 2012

create a trigger to send email

I have a basic trigger that populated an audit table, but I want to add logic to that to send an email everytime the trigger is called,
Is there a easy way to add code to my basic trigger to send an email to me everytime the data changes.
ThanksAssuming you know how to use triggers, look at this article
http://www.sqlteam.com/item.asp?ItemID=5003
HTH

Thursday, March 22, 2012

Create a DTS package to retrieve records from db & schedule to send the email at

hi,
i would like to create a DTS package to retrieve records from database , this records i retrieve is from the error log table ( ERROR_LOG_TB),the scheduler will run at 9 am daily and will retrieve the records if there is a error and the error information will be capsulate and sent through email.
Can i know how to know how to graphically do in DTS ? i am running SQL Server 2000.The thing that you are looking for can be done thru a "execute sql task" and using xp_sendmail. do you have any prior experience with DTS?
-rohit|||i got some prior experience in DTS but jus not sure how to do this in graphically . programming wise i know how to do it , i just want to get some knowledge how to do it in DTS|||Get in touch with http://www.sqldts.com website which has got plenty of DTS resources and code examples.

Also refer to books online for information about DTS as a first hand help.sql

Tuesday, March 20, 2012

Create a Condition for a DTS Task

I simply want an email to go out if any records in a table exist, else no email. I have other steps completed in this DTS job but this is the last step. Any ideas?
ddaveNever mind. I decided it be best to drop it into a stored procedure.

ddave

Sunday, March 11, 2012

CR/LF in Comment field in emails sent using DataDrivenSubscriptions

I am setting up a data driven subscription to send out an email which includes a report. The Sql for the data driven subscription outputs the EmailTo, Subject, Comment(Body) and some report parameters. My issue is with the Comment (Body) field which I would like to format with CR/LF to make the email body look neat and readable. I've tried many different permutations of inserting the CR/LF, From concatenating Char(13) + Char(10) in which the email does recognize the Cr/LF to concatenating binary 0x0D + 0x0A which after the first concatenation of binary nothing else can be concatenated. Here is the code I've tried:

~~~~~~~~

declare @.iEndDate datetime
set @.iEndDate = dbo.fn_today()

Declare @.Account_group int
Set @.Account_group = 999

/*
DECLARE @.mybin1 binary(5), @.mybin2 binary(5)
SET @.mybin1 = 0x0D
SET @.mybin2 = 0x0A
*/

Declare @.CrLf VarChar(5)
set @.CrLf = CHAR(13) + CHAR(10)

Declare @.Str1 VarChar(255)
Declare @.Str2 VarChar(255)
Declare @.Str3 VarChar(255)
Declare @.Str4 VarChar(255)
Declare @.Str5 VarChar(255)
Declare @.Str6 VarChar(255)
Declare @.Str7 VarChar(255)
Declare @.Str8 VarChar(255)
Declare @.Str9 VarChar(255)
Set @.Str1 = 'Good Morning,'
Set @.Str2 = 'We are exposed by '
Set @.Str3 = 'Attached please find the margin call detail.'
Set @.Str4 = 'Please let us know if you have any questions.'
Set @.Str5 = 'Thank you.'
Set @.Str6 = 'Please respond to:'
Set @.Str7 = ''
Set @.Str8 = ''
Set @.Str9 = ''

declare @.t table
(
EmailTo VarChar(255),
ReplyTo VarChar(255),
Subject VarChar(255),
Comment Text,
Account_group Int,
Trading_Account_Id Int,
Broker_Code_Ky VarChar(255),
EndDate Datetime
)

insert into @.t
select
EmailTo = '', -- isnull(bf.firm_email,''),
ReplyTo = '',
Subject = 'Margin Call Notice: - ' + Trading_account_name + ' - Exposure: ' + '$' + Convert(varchar(20), convert(Money, Mark_amount),1) ,
Comment = @.Str1 + @.CrLf + @.CrLf + @.Str2 + '$' + Convert(varchar(20), convert(Money, Mark_amount),1) + '.' + @.CrLf + @.CrLf + @.Str3 + @.CrLf + @.CrLf + @.Str4 + @.CrLf + @.CrLf + @.Str5 + @.CrLf + @.CrLf + @.Str6 + @.CrLf + @.Str7+ @.CrLf + @.Str8 + @.CrLf + @.Str9,
Account_group = @.Account_group,
Trading_Account_Id = trading_account_Id,
Broker_Code_Ky = EGS.Broker_Code_Ky,
EndDate = @.iEndDate
from fni_ExposureGovernmentSummary (@.iEndDate) EGS

join broker_group bg
on EGS.broker_code_ky = bg.broker_code_ky

Join broker_firm bf
on bg.fbe_firm_id = bf.broker_firm_id
Order by
Broker_Group_Name,
Trading_account_Name

select top 2 * from @.t

--~~~~~~~~~~~~~

The Email my company is using is Lotus Notes.

The Question is how do I code the the Comment field so that my email will recognize the Cr/LF.

Thanks

Elias

Try swapping the values - use Char(10) & Char(13) rather than Char(13) & Char(10).

Thanks.