Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

send email question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 03 Oct 2007 17:45 GMT
I have a page with a textbox that a user can enter in mutliple email addresses such as:

user1@yahoo.com;user2@yahoo.com;user3@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
IfThenElse - 03 Oct 2007 17:49 GMT
You can send one by one   OR

You can put only one email address in the To  and the reset in the BCC

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

 user1@yahoo.com;user2@yahoo.com;user3@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
Mike - 03 Oct 2007 18:54 GMT
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?

 You can send one by one   OR

 You can put only one email address in the To  and the reset in the BCC

   "Mike" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
   I have a page with a textbox that a user can enter in mutliple email addresses such as:

   user1@yahoo.com;user2@yahoo.com;user3@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
sloan - 03 Oct 2007 19:24 GMT
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
}

 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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
     I have a page with a textbox that a user can enter in mutliple email addresses such as:

     user1@yahoo.com;user2@yahoo.com;user3@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
Mike - 03 Oct 2007 19:27 GMT
thats what i have and its still sending 1 email with all email addresses in the [to] section

 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" <Mike@community.nospam.com> wrote in message news:uFTK2ZeBIHA.1208@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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
       I have a page with a textbox that a user can enter in mutliple email addresses such as:

       user1@yahoo.com;user2@yahoo.com;user3@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
sloan - 03 Oct 2007 20:01 GMT
Are you using my code example?  And its not working?
Or are you using a modified version of your code, and its not working?

I think your issue is this:
message.To.Add(new MailAddress(EmailAddress ));

You are just adding emails to the list.

I will suggest again, to get my sample code, and call my send mail routine, which freshly instantiates all objects.

 thats what i have and its still sending 1 email with all email addresses in the [to] section

   "sloan" <sloan@ipass.net> wrote in message news:ey$$uqeBIHA.912@TK2MSFTNGP05.phx.gbl...
   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" <Mike@community.nospam.com> wrote in message news:uFTK2ZeBIHA.1208@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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
         I have a page with a textbox that a user can enter in mutliple email addresses such as:

         user1@yahoo.com;user2@yahoo.com;user3@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
Mike - 03 Oct 2007 20:32 GMT
I have my own send mail routine that I'm using, I can't find no code example on the url you provided

 Are you using my code example?  And its not working?
 Or are you using a modified version of your code, and its not working?

 I think your issue is this:
 message.To.Add(new MailAddress(EmailAddress ));

 You are just adding emails to the list.

 I will suggest again, to get my sample code, and call my send mail routine, which freshly instantiates all objects.

   "Mike" <Mike@community.nospam.com> wrote in message news:OmPhAseBIHA.3940@TK2MSFTNGP05.phx.gbl...
   thats what i have and its still sending 1 email with all email addresses in the [to] section

     "sloan" <sloan@ipass.net> wrote in message news:ey$$uqeBIHA.912@TK2MSFTNGP05.phx.gbl...
     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" <Mike@community.nospam.com> wrote in message news:uFTK2ZeBIHA.1208@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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
           I have a page with a textbox that a user can enter in mutliple email addresses such as:

           user1@yahoo.com;user2@yahoo.com;user3@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
sloan - 03 Oct 2007 20:51 GMT
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

About 3/4's of the way down.

You'll see the following line:

You can download the code HERE. (Right-Click and "Save As" works best)

 I have my own send mail routine that I'm using, I can't find no code example on the url you provided
   "sloan" <sloan@ipass.net> wrote in message news:%23RXtCMfBIHA.464@TK2MSFTNGP02.phx.gbl...

   Are you using my code example?  And its not working?
   Or are you using a modified version of your code, and its not working?

   I think your issue is this:
   message.To.Add(new MailAddress(EmailAddress ));

   You are just adding emails to the list.

   I will suggest again, to get my sample code, and call my send mail routine, which freshly instantiates all objects.

     "Mike" <Mike@community.nospam.com> wrote in message news:OmPhAseBIHA.3940@TK2MSFTNGP05.phx.gbl...
     thats what i have and its still sending 1 email with all email addresses in the [to] section

       "sloan" <sloan@ipass.net> wrote in message news:ey$$uqeBIHA.912@TK2MSFTNGP05.phx.gbl...
       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" <Mike@community.nospam.com> wrote in message news:uFTK2ZeBIHA.1208@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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
             I have a page with a textbox that a user can enter in mutliple email addresses such as:

             user1@yahoo.com;user2@yahoo.com;user3@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
IfThenElse - 03 Oct 2007 21:29 GMT
BCC will still send personalized.

 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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
     I have a page with a textbox that a user can enter in mutliple email addresses such as:

     user1@yahoo.com;user2@yahoo.com;user3@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
Mike - 04 Oct 2007 12:55 GMT
but they won't see user1@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
 BCC will still send personalized.

   "Mike" <Mike@community.nospam.com> wrote in message news:uFTK2ZeBIHA.1208@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" <sql_agentman@hotmail.com> wrote in message news:Oj8Wk1dBIHA.748@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" <Mike@community.nospam.com> wrote in message news:usBxMzdBIHA.5540@TK2MSFTNGP03.phx.gbl...
       I have a page with a textbox that a user can enter in mutliple email addresses such as:

       user1@yahoo.com;user2@yahoo.com;user3@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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.