public static string SetForSending(string pFilePath, string pFrom, string pTo, string pCc, string pBcc, string pServer, string pPassword, string pSubject, string pBody) { var _emailItem = new EmailItem(pFrom, pTo, pCc, pBcc, pServer, pPassword, pSubject, pBody); _emailItem.Serialize(pFilePath); return(string.Format("Email.SetForSending: {0}\r\n{1}", pFilePath, _emailItem)); }
public static bool CheckPending(string pFilePath) { var _emailItem = EmailItem.Deserialize(pFilePath); var _msg = createMailMessage(_emailItem.From, _emailItem.To, _emailItem.CC, _emailItem.BCC, _emailItem.Server, _emailItem.Password, _emailItem.Subject, _emailItem.Body); //pLog(LogSeverity.Status, "Email.CheckPending", string.Format("File: {0}\r\nMessage: {1}", pFilePath, toString(_msg))); var _smtpClient = new SmtpClient(_emailItem.Server); _smtpClient.Credentials = new NetworkCredential(_msg.From.Address, _emailItem.Password); _smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; _smtpClient.Send(_msg); return(true); }