troubleshooting Question

Need to send email w/unique attachment to each customer in a sql table using vb .net

Avatar of chem_kid
chem_kid asked on
Visual Basic Classic.NET ProgrammingEmail Protocols
7 Comments1 Solution260 ViewsLast Modified:
I don't mean to be redundant here, so I appologize if I am.....I see solutions similar to this, but I need more hand holding for the code.
I have added a form to my application which sends emails quite nicely via smtp.  I used the namespace to do so. far so here is what I can't seem to get working correctly:  My boss asked me to create an app which opens an existing table (i.e. customer billing info) in ms sql 2005, allows a user to be able to choose which customers an email is going to be sent to, and be able to hit a send button which would send the emails out.  
Here's the thing....the emails will be billing invoices.  The invoice is a different pdf file unique to each customer obviously.  Sending the attachment is no problem, nor is multiple attachments.  what I am having a problem with is sending a particular attachment(s) to a particular customer.

In essense, let's say I want it set up so that a list box containing each customer is shown on a form.  The user should be able to select the name(s) from the list, be able to type a common message in a text box on the form (i.e. "Here is your bill for August, 2007"), and be able to hit send.  An email will be sent out to each selected customer, along with a common from, subject, message body, and a unique pdf attachment.  The path of the attachment i suppose could be stored in a temp sql table if it's best.

Help me!  Should this loop through and send each mail one by one?  Should it send a bulk of emails at once?  I need to see the code for this in detail.  I hope someone can help.  BTW...I need to also have a record somewhere of what mails were send successfully or not.
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros