// smpt settings in web.config public static void SendEmailBasePerson(PersonBase person) { MailMessage mailMessage = new MailMessage(fromMailAddres, toMailAddres); mailMessage.Subject = "Post Report"; mailMessage.Body = person.ToString(); SmtpClient smtpClient = new SmtpClient(); smtpClient.Send(mailMessage); }
public override string ToString() { string temp_exam = ""; PersonBase.ToString(); string temp_credit = ""; for (int i = 0; i < _exams.Count; i++) { temp_exam += _exams[i].ToString() + "\r\n"; } for (int i = 0; i < _credits.Count; i++) { temp_credit += _credits[i].ToString() + "\r\n"; } return("Education: " + _osvita + "\nGroup: " + _group + "\nExams: " + temp_exam + "\nCredit: " + temp_credit + "Average mark: " + GetEverage); }