Sending Emails to Multiple Receipents and with multiple options

J

Jai

Hi,

I am in a problem of sending mass emails(newsletter) to my website
members.

Actually my problem is this:

I want to send newsletter to my website members. But I had given a
facility for each member to choose different category of products or
all products newsletter.

How can I extract all emails and category options from the database and
accordingly i want to generate a single newsletter for each member.

My ASP.NET 2.0 code:

Sub email()
Dim objDR As OleDbDataReader
Dim sEmail As String
Using connection As New
OleDbConnection(ConfigurationManager.ConnectionStrings("Personal").ConnectionString)
Using command As New OleDbCommand("usp_GetNewsletterEmail",
connection)
Try
command.CommandType = CommandType.StoredProcedure
connection.Open()
objDR =
command.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

While objDR.Read()

'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New
MailAddress("(e-mail address removed)")

sEmail = objDR("UserEmail")

mail.To.Add(sEmail)

'set the content
mail.Subject = "MySite: Weekly Newsletter"

'first we create the Plain Text part
Dim plainView As AlternateView =
AlternateView.CreateAlternateViewFromString("This is my plain text
content, viewable by those clients that don't support html", Nothing,
"text/plain")

'then we create the Html part
Dim htmlView As AlternateView =
AlternateView.CreateAlternateViewFromString("<b>this is bold text, and
viewable by those mail clients that support html</b>", Nothing,
"text/html")

mail.AlternateViews.Add(plainView)
mail.AlternateViews.Add(htmlView)

'send the message
Dim smtp As New SmtpClient("127.0.0.1")
'specify the mail server address
smtp.Send(mail)

End While

Catch ex As Exception

End Try
End Using
End Using

End Sub

In the above code, I am able to extract email address of each member
but the problem is that each members has its own option for newsletter
like somebody wants to get newletter of "Hardware", and somebody else
wants "Hardware + Software + Electronics" and someother one wants "ALL
Products".................

I am storing all these options in my database against each user email
address.............

now when i am fetching emails and options(each user has its own
options) from the database...

i am able to send newsletter to each member but not with its own
options.

Please help me..........how will i be able to send newsletter to my
each members with its own options..so that the members get the email at
once....

Please tell me how the newsletter contains the images....with
scheduling(automatic emails once in a week).

With Regards,
 
M

Marina Levit [MVP]

I am not sure what is your problem?

If you need to send a separate email to each member, then do so. If you have
lot's of members, that means they all won't get the email at the exact same
instant. So what?

To make them closer together, you can construct all the email objects, but
not send them. Then loop through and actually send each one. This will make
them all be sent much closer together, since there won't be the delay of
constructing the emails in between, since you did all that up front.
 
P

Patrice

You could see how much different set of optiosn you have so that each
variatino of the letter is created once and then sent to all those who
requested the same options...

The trivial approcahc would be jsut to create a different letter for each
user (with the drawback that if two users have the same options the letter
will be still created twice).
 
J

Jai

Hi Marina,

But how can i dynamically create a webform(newsletter) with my database
data and then send the newsletter to each member with there own
specific options........
Please provide any code for this if you can

Thanks in advance
Jai
 
J

Jai

Hi Marina,

But how can i dynamically create a webform(newsletter) with my database
data and then send the newsletter to each member with there own
specific options........
Please provide any code for this if you can

Thanks in advance
Jai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top