i have been sending emails successfuly using my windows application, but all of the sudden my application is failing to send emails and am getting an error
string smtAddress = "smtp.mail.yahoo.com";
int portNumber = 587;
bool enableSSL = true;
DateTime dat = DateTime.Parse(label55.Text.ToString());
string emailFrom = "
[email protected]";
string password = "kyozimayenje";
string emailTo = "
[email protected]";
string subject = dat.ToString("dd/MM/yyyy") + " - " + "Testing Bank Emailing System";
string body = "Dear Customer Banking Emailing System Undergoing Testing";
using (MailMessage mail = new MailMessage())
{
mail.From = new MailAddress(emailFrom);
mail.To.Add(emailTo);
mail.Subject = subject;
mail.Body = body;
mail.IsBodyHtml = true;
//Attachments
//mail.Attachments.Add(new Attachment("C:\\Import of Used clothing & stationary research.pdf"));
SmtpClient smtp = new SmtpClient(smtAddress, portNumber);
{
smtp.Credentials = new NetworkCredential(emailFrom, password);
smtp.EnableSsl = enableSSL;
smtp.Send(mail);
}
}
any help will be greatly appreciated