2
Answers

Please Help - Send Emails to All Email Addresses in Datagrid

Anthony Clarke

Anthony Clarke

14y
7.6k
1
Hi,
Just wanted put this out there to all the brainiacs because i just cant seem to do this.
I have a datagrid with columns
Date, DateNow, DateDifference, Email
 
They are all populated and i was wondering if when date difference hits 7 days it could send an email to everyone that has a date difference of 7 days or more.
 
I know how to send a single email but not how to go through the whole datagrid and do it.
Outlook.
Application oApp = new Outlook.Application();
Outlook.
MailItem email = (Outlook.MailItem)(oApp.CreateItem(Outlook.OlItemType.olMailItem));
email.Recipients.Add(textBox1.Text); //*need this for datagridview
email.Subject = "Reminder - 7 days difference;
email.Body = "7 Days Difference";
((Outlook.
MailItem)email).Send();
 
Thanks alot for your patience and time.
Regards
Anthony
Answers (2)
3
Nitin Sontakke

Nitin Sontakke

NA 11.7k 2.2k 8y
Web technologies are evolving day-by-day and i am not quite up-to-date with the evolution.
 
However, I am pretty certain that you would need some sort of server-side processing. From the way you have framed the question, it seems to me, that you are not quite clear about the request-response model of http protocol on which the web works.
 
Connecting to sql server from javaScript, while might be possible (I am not sure), it is not a very good idea from security perspective, i guess.
 
And where would you put all your business logic?
 
Calling asp.net a front-end would be incorrect. It is a server side technology.
 
You can have all your front-end in HTML5, CSS and Javascript and write a server-side code in WebAPI.
 
You may wish to look into serverless architecture (I still not have looked into!)