private void SendingMail(string toList, string subject, string sentby) { //Sending Mail.... MailMessage message = new MailMessage(); SmtpClient smtpClient = new SmtpClient(); string msg = string.Empty; string body = "You have received a file from Honey"; MailServerIp = "172.185.30.9"; // Changed IP not orginal MailFrom = "Honey@gmail.com";// Just sample mail not orginal MailFromPwd = "asdfasdf" ; // just sample pwd not original try { MailAddress fromAddress = new MailAddress(MailFrom); message.From = fromAddress; message.To.Add(toList); message.Subject = "Mail Alert Sent Successfylly"; message.IsBodyHtml = true; if (body != "") message.Body = body; smtpClient.Host = MailServerIp; smtpClient.Credentials = new NetworkCredential(fromAddress.ToString(), MailFromPwd); smtpClient.Send(message); //send..... message.To.Clear(); } catch (Exception ex) { msg = ex.Message; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)