473,910 Members | 4,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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 2183
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.comwrot e in message news:us******** ******@TK2MSFTN GP03.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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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**********@h otmail.comwrote in message news:Oj******** *****@TK2MSFTNG P04.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.comwrot e in message news:us******** ******@TK2MSFTN GP03.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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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.space s.live.com/Blog/cns!A68482B9628 A842A!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.T oString().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.comwrot e in message news:uF******** ******@TK2MSFTN GP03.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**********@h otmail.comwrote in message news:Oj******** *****@TK2MSFTNG P04.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.comwrot e in message news:us******** ******@TK2MSFTN GP03.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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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.comwrot e in message news:uF******** ******@TK2MSFTN GP03.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**********@h otmail.comwrote in message news:Oj******** *****@TK2MSFTNG P04.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.comwrot e in message news:us******** ******@TK2MSFTN GP03.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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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**********@h otmail.comwrote in message news:uK******** ******@TK2MSFTN GP06.phx.gbl...
BCC will still send personalized.

"Mike" <Mi**@community .nospam.comwrot e in message news:uF******** ******@TK2MSFTN GP03.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**********@h otmail.comwrote in message news:Oj******** *****@TK2MSFTNG P04.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.comwrot e in message news:us******** ******@TK2MSFTN GP03.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.co m;us***@gmail.c om;

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 = ConfigurationMa nager.AppSettin gs["smtpServer "];
message.From = new MailAddress(Con figurationManag er.AppSettings["FromAddres s"]);

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

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

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
4500
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 current window. I have a cgi script provided by my web host to send the contents of the form through email but they only show me how to use the cgi script to send email through the submit event of the form. ie. <form name="downloadform"...
6
2466
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 MailMessage() With oMail .From = "mypc@baxglobal.com" .To = "ceckman@baxglobal.com"
3
3048
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 identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
1
1312
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 the message. i have tried to use the BodyEncoding property of the MailMessage class but it didn't make any changes(mainly it made it worst). So i want to know how i make it possible to send this mail in Turkish. Thanks
3
5416
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 http://www.systemwebmail.com/faq/2.7.aspx, I gather I could use: mail.Headers.Add( "Reply-To", "alternate_email@mycompany.com" ); When I test this from a test web app, I don't seem to field a bounced email
14
11947
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 doing something was really inefficient and could reduce 10 lines of code with 2, etc. For reading, I am using a TcpClient and I call NetworkStream ns = client.GetStream(); to get a stream stream.Read(buffer, 0, buffer.Length);
5
2379
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 name="safe_access"> <option value="0"></option> <option value="yes">Yes</option> <option value="no">No</option>
5
4966
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 (ooimpress, open office ppt), and translate the commands from client to a key event, and send it to child process. For example.
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11055
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9727
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5939
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4337
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3360
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.