473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Sending Emails to Multiple Receipents and with multiple options

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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai

Sep 12 '06 #1
5 2401
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.

"Jai" <ja***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai

Sep 12 '06 #2
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).

--
Patrice

"Jai" <ja***********@gmail.coma écrit dans le message de news:
11**********************@m73g2000cwd.googlegroups. com...
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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai

Sep 12 '06 #3
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

Marina Levit [MVP] wrote:
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.

"Jai" <ja***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai
Sep 12 '06 #4
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

Marina Levit [MVP] wrote:
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.

"Jai" <ja***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai
Sep 12 '06 #5
Store the user options in database fields and recall them as needed.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Jai" <ja***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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

Marina Levit [MVP] wrote:
>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.

"Jai" <ja***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googleg roups.com...
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.ConnectionStr ings("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("my****@mysite.com")

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>th is 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,
----------
Jai

Sep 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
0
by: Thomas Mandelid | last post by:
A client I`m working for want to be able to send multiple emails to customers of their own. I have developed a simple app to accomplish this, but the application has a few flaws and I`m looking for...
10
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
2
by: Norman Fritag | last post by:
Hi there are there any issues with sending multiple emails via GroupWise ver. 6??? please comment. Regards Norman
2
by: kimberly.shaffer | last post by:
Okay, I can automate sending of multiple emails with records using Groupwise and Access DB. But now what I need to do is send multiple fields associated with one field out automatically and can't...
3
by: VB Programmer | last post by:
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails. 1. What do I need on the server so that it has the...
2
by: Joey | last post by:
I am currently developing a C# asp.net application where users are required to register. The application then generates a simple, plain text email and sends it to the new user. I have been...
8
by: Philippe Lang | last post by:
Hello, I need to send emails from Postgresql triggers. I was able to do it with a 'plperlu' function, that calls the 'system' perl function, that itself calls the 'mail' shell function. Is...
3
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.