[Solved] CIS407A Week 7 iLab Error Notification via E-Mail
5.0
1 customer review
Digital download
Digital download
$25.00
Message us on WhatsApp for payment or download support.
// **** Add the following at the top of the class file,
// Add your comments here
using System.Net.Mail;
//**** Add the following code inside the body of public class clsBusinessLayer ****
public static bool SendEmail(string Sender, string Recipient, string bcc, string cc,
string Subject, string Body)
{
try {
// Add your comments here
MailMessage MyMailMessage = new MailMessage();
// Add your comments here
MyMailMessage.From = new MailAddress(Sender);
// Add your comments here
MyMailMessage.To.Add(new MailAddress(Recipient));
// Add your comments here
if (bcc != null && bcc != string.Empty) {
// Add your comments here
MyMailMessage.Bcc.Add(new MailAddress(bcc));
}
// Add your comments here
if (cc != null && cc != string.Empty) {
// Add your comments here
MyMailMessage.CC.Add(new MailAddress(cc));
}
// Add your comments here
MyMailMessage.Subject = Subject;
// Add your comments here
MyMailMessage.Body = Body;
// Add your comments here
MyMailMessage.IsBodyHtml = true;
// Add your comments here
MyMailMessage.Priority = MailPriority.Normal;
// Add your comments here
SmtpClient MySmtpClient = new SmtpClient();
// Add your comments here
MySmtpClient.Port = 25;
MySmtpClient.Host = "127.0.0.1";
// Add your comments here
MySmtpClient.Send(MyMailMessage);
// Add your comments here
return true;
} catch (Exception ex) {
// Add your comments here
return false;
}
}
<authentication mode="Forms">
<forms loginUrl="frmLogin.aspx" />
</authentication>
<authorization >
<deny users="?" />