knottano-gmail
-
5/3/2012 1:06:56 AM
Is this function working in V6.0 bizForm.SendNotificationEmail()
I am trying this code many times. But no email is sent.
string bizFormName = "ContactUs";
BizFormInfo bizFormInfo = BizFormInfoProvider.GetBizFormInfo(bizFormName, CMSContext.CurrentSiteID);
DataClassInfo dataClassInfo = DataClassInfoProvider.GetDataClass(bizFormInfo.FormClassID);
if (dataClassInfo != null) { var connection = ConnectionHelper.GetConnection(); var whereCondition = String.Format("ItemID = '{0}'", 1);
var dataSet = connection.ExecuteQuery(dataClassInfo.ClassName + ".selectall", null, whereCondition);
if (!DataHelper.DataSourceIsEmpty(dataSet) && dataSet.Tables[0].Rows.Count == 1) { DataRow dataRow = dataSet.Tables[0].Rows[0];
BizForm bizForm = new BizForm();
BizFormItem bizFormItem = new BizFormItem(dataRow, dataClassInfo.ClassName);
if (bizFormItem != null) { bizForm.SendNotificationEmail(bizFormInfo.FormSendFromEmail, bizFormInfo.FormSendToEmail, bizFormItem, bizFormInfo); bizForm.SendConfirmationEmail(bizFormInfo.FormSendFromEmail, bizFormInfo.FormSendToEmail, bizFormItem, bizFormInfo); } else { Response.write("data is null"); } } }
Please help, thank you
|