0

I have a user registration Form. If a new User register their account in that account. I need to send a message a new user has been registered to my company mail-id and also client mail-id. Now i do it for a single mail-id. How can I do it for 2 mail-ids?

David East
  • 31,526
  • 6
  • 67
  • 82
Prince Antony G
  • 932
  • 4
  • 18
  • 39
  • 4
    **Never** send a password by email. – SLaks Jun 24 '12 at 14:07
  • 4
    **Never** store or log readable passwords, anywhere. – SLaks Jun 24 '12 at 14:08
  • But that is my client Requirement, I need to do that – Prince Antony G Jun 24 '12 at 14:09
  • 2
    Tell your clients that they are wrong. Remind them about what happened to Sony and LinkedIn. **Do not listen to them**, or your name will be associated with the resulting disaster. – SLaks Jun 24 '12 at 14:12
  • 1
    Then at least educate your client about the implications of implementing such a insecure, stupid, naive design. If they do not understand, then please bail out and don't encourage crap design. – Magnus Johansson Jun 24 '12 at 14:13
  • 1
    Thank you @SLaks and Magnus for the lecture on security; but that didn't solve the problem. The baseline of the question is "How can I send the same email to two different email addresses", or am I wrong? Can you post some of the code you have so far? – KBoek Jun 24 '12 at 14:16
  • 2
    @KBoek Thanks for your lecture and insight. The ability to send to multiple recipients is very trivial in the .NET framework and the MailMessage() object. Out of pure principle, I will not post code that encourage bad insecure design. – Magnus Johansson Jun 24 '12 at 14:21
  • 1
    Don't forget to at least salt the passwords! – IrishChieftain Jun 24 '12 at 14:29
  • +1.. ok sure. i will explain those issues to my client. – Prince Antony G Jun 24 '12 at 16:41
  • @ Magnus,@SLaks,@IrishChieftain yeah sure. i will explain those issues to my client. but can u post me how to send a message to two mail id. i wont send user information and their password to my client and also others, but i need to send a message a new user has been registered into your account. So please provide solution for that. – Prince Antony G Jun 24 '12 at 16:50
  • 1
    Now that you have changed the **question** (I've a bad feeling that the adjusted question scope != the intended design), you have an adequate answer posted already. – Magnus Johansson Jun 24 '12 at 19:11
  • yeah i changed my question scope. my only need to send two mail, so for i have been changed – Prince Antony G Jun 25 '12 at 08:33

1 Answers1

2

see http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

System.Net.Mail.MailMessage mail = new MailMessage();

mail.To.Add("first address");
mail.To.Add("second address");
KBoek
  • 5,794
  • 5
  • 32
  • 49