/// <summary> /// Send comment posting email notification to the Webmaster /// </summary> public int SendEmailAddRecipeNotify() { //Create string builder object StringBuilder mySB = new StringBuilder(""); //Mail message subject property //Change Mydomain to your own domain name. string Subject = "Recipe Submission at Mydomain.com"; //Build the email body in HTML format using stringbuilder mySB.Append("<table cellpadding=0 cellspacing=0 width=400 align=left>"); mySB.Append("<tr>"); mySB.Append("<td align=left>"); mySB.Append("<font size=2 color=black face=verdana>"); mySB.Append("Hi Webmaster:"); mySB.Append("<br><br>"); mySB.Append("Someone submitted a recipe."); mySB.Append("<br>"); mySB.Append("Recipe Name:"); mySB.Append(" "); mySB.Append(ItemName); mySB.Append("</font>"); mySB.Append("</td></tr>"); mySB.Append("</table>"); EmailNotificationSettings EmailSettings = new EmailNotificationSettings(); EmailSettings.fillup(); int Err = EmailHelper.SendEmail(EmailSettings.ToAdminEmail, EmailSettings.FromAdminEmail, Subject, mySB.ToString()); EmailSettings = null; return Err; }
//Handles Admin email and SMTP server address private void GetEmailandSMTPInfo() { //Instantiate Object EmailNotificationSettings EmailSettings = new EmailNotificationSettings(); EmailSettings.fillup(); emailadd.Text = EmailSettings.FromAdminEmail; smtpadd.Text = EmailSettings.ToAdminEmail; EmailSettings = null; }
/// <summary> /// Send exception error notification. /// </summary> public int SendExceptionErrorNotification(string strURL, string ExceptionError) { //Create string builder object StringBuilder mySB = new StringBuilder(""); //Mail message subject property string Subject = "XD Recipe Exception Error Notification"; //Build the email body in HTML format using stringbuilder mySB.Append("<table cellpadding=0 cellspacing=0 width=400 align=left>"); mySB.Append("<tr>"); mySB.Append("<td align=left>"); mySB.Append("<font size=2 color=black face=verdana>"); mySB.Append("Hi Webmaster:"); mySB.Append("<br><br>"); mySB.Append("This error has been logged to the database."); mySB.Append("<br><br>"); mySB.Append("<b>Exception:</b>"); mySB.Append("<br>"); mySB.Append(ExceptionError); mySB.Append("</font>"); mySB.Append("</td></tr>"); mySB.Append("<tr>"); mySB.Append("<td align=left><br>"); mySB.Append("<font size=2 face=verdana>"); mySB.Append("<a target=_new href=\"http://"); mySB.Append(strURL); mySB.Append("\">"); mySB.Append(strURL); mySB.Append("</a>"); mySB.Append("</font>"); mySB.Append("</td></tr>"); mySB.Append("</table>"); EmailNotificationSettings EmailSettings = new EmailNotificationSettings(); EmailSettings.fillup(); int Err = EmailHelper.SendEmail(EmailSettings.ToAdminEmail, EmailSettings.FromAdminEmail, Subject, mySB.ToString()); EmailSettings = null; return Err; }
/// <summary> /// Send comment posting email notification to the Webmaster /// </summary> public int SendEmailCommentNotify() { //Create string builder object StringBuilder mySB = new StringBuilder(""); string strURL = BaseUrl.GetBaseUrl + "recipedetail.aspx?id=" + ItemID; //Mail message subject property string Subject = "Recipe Comment Posting"; //Build the email body in HTML format using stringbuilder mySB.Append("<table cellpadding=0 cellspacing=0 width=400 align=left>"); mySB.Append("<tr>"); mySB.Append("<td align=left>"); mySB.Append("<font size=2 color=black face=verdana>"); mySB.Append("Hi Webmaster:"); mySB.Append("<br><br>"); mySB.Append("Someone has posted a recipe comment. Click the link below to view the comment."); mySB.Append("</font>"); mySB.Append("</td></tr>"); mySB.Append("<tr>"); mySB.Append("<td align=left><br>"); mySB.Append("<font size=2 face=verdana>"); mySB.Append("<a target=_new href=\"http://"); mySB.Append(strURL); mySB.Append("\">"); mySB.Append(ItemName); mySB.Append("</a>"); mySB.Append("</font>"); mySB.Append("</td></tr>"); mySB.Append("</table>"); EmailNotificationSettings EmailSettings = new EmailNotificationSettings(); EmailSettings.fillup(); int Err = EmailHelper.SendEmail(EmailSettings.ToAdminEmail, EmailSettings.FromAdminEmail, Subject, mySB.ToString()); EmailSettings = null; return Err; }