|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 3:18 AM
Points: 115,
Visits: 326
|
|
Hi, Please help on below scenario to send mail.
I am having a table which contains student attendance. If student is absent then the mail should automatically goes to HOD. But issue is that i don't want to send mail one for each student. Suppose there is maths department and 7 students are absent then all 7 students name i want to send to HOD by the mail. I am able to send but 7 mails are going. Can you please help? its urgent.
Thanks Abhas
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 12:38 AM
Points: 192,
Visits: 407
|
|
you can use the procedure to first have the list of students absent in a particular department and then use the procedure sp_send_dbmail to send the list of absentees in the mail.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 3:18 AM
Points: 115,
Visits: 326
|
|
Hi Jeet,
I want to use this by using SSIS.
Thanks Abaso jadhav
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, March 21, 2013 2:14 AM
Points: 77,
Visits: 184
|
|
abhas (12/4/2012) Hi Jeet,
I want to use this by using SSIS.
Thanks Abaso jadhav
Store the names of student in string variable using Execute Sql Task and then use send mail task to send mail.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 3:18 AM
Points: 115,
Visits: 326
|
|
Hi rhythm
I am doing the same but emails are going repeatedly. Example if there are 5 students then 5 different mails are going.
Thanks Abhas.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, March 21, 2013 2:14 AM
Points: 77,
Visits: 184
|
|
abhas (12/5/2012) Hi rhythm
I am doing the same but emails are going repeatedly. Example if there are 5 students then 5 different mails are going.
Thanks Abhas.
Probably you have include your mail task in loop container or so. Please check and if not then attach screenshots or explain your package ?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 3:18 AM
Points: 115,
Visits: 326
|
|
Hi rhythm,
I am doing below steps.
1) Execute sql task - here I am fetching studid,studname,deptname,HodName,HodMail. 2) I am using foreach loop 3) In foreach loop I am using script task and sendmail task
In script task I am fetching mailid's and writting body of message. But what happens in this case suppose there are 3 students belongs to physics dept then 3 separate mails are going to HOD.
I want to send single mail for three students as;
Dear Sir, student1,student2,student3 are absent today.Please take required action.
Thanks Abaso Jadhav
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, March 21, 2013 2:14 AM
Points: 77,
Visits: 184
|
|
abhas (12/5/2012) Hi rhythm,
I am doing below steps.
1) Execute sql task - here I am fetching studid,studname,deptname,HodName,HodMail. 2) I am using foreach loop 3) In foreach loop I am using script task and sendmail task
In script task I am fetching mailid's and writting body of message. But what happens in this case suppose there are 3 students belongs to physics dept then 3 separate mails are going to HOD.
I want to send single mail for three students as;
Dear Sir, student1,student2,student3 are absent today.Please take required action.
Thanks Abaso Jadhav
Thats what I doubted.Use send mail task outside for each loop. I hope you are using package level variable for stroing email ids.
|
|
|
|