yea solving xp_sendmail !! this is a nightmare
Help, I really really would appreciate anyone who can help me , I am about
to go crazy , it doesnot work !!!!
hi, I have 3 tables.
Table_A has the following fields:
us_company_id,
us_company_name,
us_email,
industry_code etc
Table_B has the following fields:
company_id,
company_name,
email,
industry_code etc
Table_C has the following fields: ( I append matching between tbl_a & tbl_b
via store procedure)
counter int identity (1,1),
us_company_id int,
us_company_name varchar(30),
us_email varchar(30),
matched_industry_code varchar(30),
matching_date datetime,
company_id int,
company_name varchar(30),
email varchar(30),
I already put an insert trigger in both tbl_a & tbl_b to execute a store
procedure to append the matching records between tbl_a & tbl_b to the tbl_c.
Now I want to send an email to both companies to inform them of the matching
. I want the email to be send daily at 11 pm. Here where I am having a
problem. how can I apply xp_sendmail to successfully send the mail to the
us_companies and inform them about the matching and also send them the
contact information of the companies that have already matched with them by
industry code.
what I did is that I have set up the following codes to have control for
each row of tbl_c :
can you please verrify this and tell me if I am in the right track:
BEGIN
From tbl_C
-- action
used in the xp_sendmail
-- The other 2 variables used to pull the contact information from tbl_a
&tbl_b by sepicifying the -- us_company_id &
company_id
where counter =
-- this pull the email from the table
where counter =
-- this pull the email from the table
where counter =
where counter =
-- sending us_company, a contact information from table b
-- sending company, a contact information from table a
END