469,623 Members | 1,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

send email question

I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 3 '07 #1
5 1956
You can send one by one OR

You can put only one email address in the To and the reset in the BCC
"Mike" <Mi**@community.nospam.comwrote in message news:us**************@TK2MSFTNGP03.phx.gbl...
I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 3 '07 #2
we want to make a little "personal" so the person sees their name in the TO instead of nothing or everyone.

how would the one by one work? If they enter in 5 in the textbox, how can I fire off one email at a time without having the user enter in 1 address, click send, then enter in another one - click send and so on?

"IfThenElse" <sq**********@hotmail.comwrote in message news:Oj*************@TK2MSFTNGP04.phx.gbl...
You can send one by one OR

You can put only one email address in the To and the reset in the BCC
"Mike" <Mi**@community.nospam.comwrote in message news:us**************@TK2MSFTNGP03.phx.gbl...
I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 3 '07 #3
Then you gotta loop and send them seperately.
If you get my downloadable example code at:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

I have the routine better encapsulated, so sending emails one by one would be a little cleaner.

But you want this:

void SendThem()
{

String[] temp = TextBox1.Text.ToString().Split(';');
foreach (string EmailAddress in temp)
{

//be nice to add this
if( IsValidEmail ( SendTheEmail ) /// you gotta write this function, but it would be better than sending emails to bad addresses
{

SendTheEmail( EmailAddress );

}

}
}
}

void SendTheEmail( string to )
{
//Code Here // See my blog entry
}

"Mike" <Mi**@community.nospam.comwrote in message news:uF**************@TK2MSFTNGP03.phx.gbl...
we want to make a little "personal" so the person sees their name in the TO instead of nothing or everyone.

how would the one by one work? If they enter in 5 in the textbox, how can I fire off one email at a time without having the user enter in 1 address, click send, then enter in another one - click send and so on?

"IfThenElse" <sq**********@hotmail.comwrote in message news:Oj*************@TK2MSFTNGP04.phx.gbl...
You can send one by one OR

You can put only one email address in the To and the reset in the BCC
"Mike" <Mi**@community.nospam.comwrote in message news:us**************@TK2MSFTNGP03.phx.gbl...
I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 3 '07 #4
BCC will still send personalized.

"Mike" <Mi**@community.nospam.comwrote in message news:uF**************@TK2MSFTNGP03.phx.gbl...
we want to make a little "personal" so the person sees their name in the TO instead of nothing or everyone.

how would the one by one work? If they enter in 5 in the textbox, how can I fire off one email at a time without having the user enter in 1 address, click send, then enter in another one - click send and so on?

"IfThenElse" <sq**********@hotmail.comwrote in message news:Oj*************@TK2MSFTNGP04.phx.gbl...
You can send one by one OR

You can put only one email address in the To and the reset in the BCC
"Mike" <Mi**@community.nospam.comwrote in message news:us**************@TK2MSFTNGP03.phx.gbl...
I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 3 '07 #5
but they won't see us***@yahoo.com in the To: section of the email when they get it and thats what I want.
Multiple emails to 1 or more people but each person sees their email address and only their address in the[To:] section of the email
"IfThenElse" <sq**********@hotmail.comwrote in message news:uK**************@TK2MSFTNGP06.phx.gbl...
BCC will still send personalized.

"Mike" <Mi**@community.nospam.comwrote in message news:uF**************@TK2MSFTNGP03.phx.gbl...
we want to make a little "personal" so the person sees their name in the TO instead of nothing or everyone.

how would the one by one work? If they enter in 5 in the textbox, how can I fire off one email at a time without having the user enter in 1 address, click send, then enter in another one - click send and so on?

"IfThenElse" <sq**********@hotmail.comwrote in message news:Oj*************@TK2MSFTNGP04.phx.gbl...
You can send one by one OR

You can put only one email address in the To and the reset in the BCC
"Mike" <Mi**@community.nospam.comwrote in message news:us**************@TK2MSFTNGP03.phx.gbl...
I have a page with a textbox that a user can enter in mutliple email addresses such as:

us***@yahoo.com;us***@yahoo.com;us***@gmail.com;

and so on, I then have a foreach loop to get all of the emaill addresses and send emails out.

the problem is that all of the email addresses the email is being sent to is showing in the [TO] section so everyone knows who's getting the email.

How can I have 1 email address showing in the [TO] section so no one knows who else is getting the email?

this is what I have;

SmtpClient smtp = new SmtpClient();
MailMessage message = new MailMessage();
smtp.Host = ConfigurationManager.AppSettings["smtpServer"];
message.From = new MailAddress(ConfigurationManager.AppSettings["FromAddress"]);

String[] temp = TextBox1.Text.ToString().Split(';');

foreach (string EmailAddress in temp)
{
message.To.Add(new MailAddress(EmailAddress ));
message.Subject = "a subject will go here;
message.Body = stuff will go here";
smtp.Send(message);
}

I don't want the people that get this email see who else gets it. And a group is not possible due to the address can change
Oct 4 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Cameron Eckman | last post: by
1 post views Thread by alexmaster_2004 | last post: by
3 posts views Thread by Frank | last post: by
5 posts views Thread by canajien | last post: by
5 posts views Thread by Mirxon | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.