473,382 Members | 1,526 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,382 software developers and data experts.

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 2135
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the...
6
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
1
by: alexmaster_2004 | last post by:
Hi There i'm using System.Web.Mail to send email message. but i have a problem with it. the emails that i send is in Turkish Language. so when i send the email the receipt can't be able to raed...
3
by: Frank | last post by:
I am attempting to develop a solution where I handle bounced e-mails. I wish to field all bounced emails in a custom email account such a bounced@mycompany.com From the aricle at...
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
5
by: canajien | last post by:
I have a form that stores information in a table, but I also need it to send an email when a specific question, among the many, is answered with no the question is a simple drop box: <select...
5
by: Mirxon | last post by:
Hello, I'm working on a C program under Ubuntu. It's basd on socket. Browser calls a client cgi (C program), and send some parameters to server (C program). Server runs another program...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.