Advertisement
CGC_Codes

Email pass sender

Feb 20th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace sirhcApplication.Common
  7. {
  8.     public static class EmailUtility
  9.     {
  10.         public static bool SendPasswordEmail(string email, string password)
  11.         {
  12.             try
  13.             {
  14.                 System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(email, "Sirhc.sirhcmail.com");
  15.                 mail.Subject = "Your sirhc Password";
  16.                 mail.Body = "Your Sirhc account password is " + password;
  17.                 System.Net.Mail.SmtpClient clnt = new System.Net.Mail.SmtpClient();
  18.                 clnt.Send(mail);
  19.  
  20.             }
  21.             catch (System.Net.Mail.SmtpException)
  22.             {
  23.                 return false;
  24.             }
  25.  
  26.             return false;
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement