Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

Need to send emails from SQL Server database

$
0
0
Hello,

I need to send copies of the invoices from yesterday's sales to the customers that would like an email copy of them. I currently have the invoice created in a Crystal Reports and export it as a pdf. My issue is how do I get the list of email addresses and then loop to send them. My background is not in VB but I do work with it regularly. I use old code and modify it. I have code that now looks in the database and gets an email address for different reports. They are all Crystal Reports and export as a pdf. I have created my Invoice Crystal report and it works well by me providing the invoice number. I also have the logic to just check yesterday even though it may be Monday or there may have been a holiday.

So what I need to do is develop the code the check my SQL Server table for a key (T/F) that they do want the invoice emailed. Of course there are some emails in the table that do not want or need the invoice sent. Then get the email address and then send the invoice pdf to that email address. I would use my outlook account to send these. I could create a view in SQL that would only have the customers that have that "Y" in the request email invoice field and then that would relieve me of the requirement to even check that. However, my question is that I am looking for some very specific guidance to be able to loop through the table or view and check for a customer that wants their invoice and had a sale yesterday.

Thank you all in advance!

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>