Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to implement the sending an email functionality to the employees on the click event of radio button which has values Yes or No.
If the Yes is the value of radio button get selected then only the email to that employee should be send.
Please help me out...and give proper direction as early as possible.
Posted
Comments
NaibedyaKar 18-Oct-14 3:30am    
What have tried for this. It is as simple as checking which option of the radio button checked and then sending the email.where is the issue are you facing exactly.
Member 10584788 18-Oct-14 4:30am    
That is ok...i want the exact code which will be called on click of radio button ...and have created the SendEmail as a region in APIManager file in which i had written code below...and i m using three tier architecture of asp.net


#region Send UserPPR Email

private void SendUserPPREmail(string SenderName, string SenderEmail, string ReceiverName, string ReceiverEmail, string UserID, string CustomerID, string PPRTypeID, string CallTypeID, string PPID, string DivisionID, string ProductID, string ModelID, string Comments, string MachineSrNo, string PartComments,string HMR,string ExpWorking,string Category,string PartID,string Quantity,string CCEmails, string Date)
{
ListDictionary replacements = new ListDictionary();
replacements.Add("<%SenderName%>", SenderName);
replacements.Add("<%SenderEmail%>", SenderEmail);
replacements.Add("<%ReceiverName%>", ReceiverName);
replacements.Add("<%UserID%>", UserID);
replacements.Add("<%CustomerID%>", CustomerID);
replacements.Add("<%PPRTypeID%>",PPRTypeID);
replacements.Add("<%CallTypeID%>", CallTypeID);
replacements.Add("<%PPID%>", PPID);
replacements.Add("<%DivisionID%>", DivisionID);
replacements.Add("<%ProductID%>", ProductID);
replacements.Add("<%ModelID%>",ModelID);
replacements.Add("<%Comments%>",Comments);
replacements.Add("<%MachineSrNo%>",MachineSrNo);
replacements.Add("<%PartComments%>",PartComments);
replacements.Add("<%HMR%>",HMR);
replacements.Add("<%ExpWorking%>",ExpWorking);
replacements.Add("<%Category%>",Category);
replacements.Add("<%Part ID%>",PartID);
// replacements.Add("<%%>",);

//replacements.Add("<%RepairStatus%>", RepairStatus);
//replacements.Add("<%Amount%>", Amount == "" ? "N/A" : Amount);
//replacements.Add("<%ReceiptNo%>", ReceiptNo == "" ? "N/A" : ReceiptNo);
replacements.Add("<%Date%>", Date);

EmailManager.SendEmailUsingTemplate(SenderEmail, ReceiverEmail, "User PPR Report", Server.MapPath("EmailTemplates/UserPPREmail.txt"), replacements, ConfigurationManager.AppSettings["SmtpServerName"].ToString(), CCEmails);
}

#endregion


and also created the two extra files as UserPPREmail.txt and UserPPREmail.html in EmailTemplate

UserPPREmail.txt
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Hello <%ReceiverName%>,<br><br />
Please find below the details Of Parts Details - <%PPRID%><br /><br />

Date - <%Date%><br /><br />
PPR ID - <%PPRID%><br /><br />
User ID - <%UserID%><br /><br />
Customer ID - <%CustomerID%><br /><br />
PPR Type ID- <%PPRTypeID%><br /><br />
Call Type ID - <%CallTypeID%><br /><br />
PP ID - <%PPID%><br /><br />
Division ID - <%DivisionID%><br /><br />
Product ID - <%ProductID%><br /><br />
Model ID - <%ModelID%><br /><br />
Comments - <%Comments%><br /><br />
Machine SrNo - <%MachineSrNo%><br /><br />
Part Comments - <%PartComments%><br /><br />
HMR - <%HMR%><br /><br />
Exp Working-<%ExpWorking%><br /><br />
Category-<%Category%><br /><br />
Part ID-<%PartID%><br /><br />
Thanks,<br />
<%SenderName%><br />
Email - <%SenderEmail%><br />
</body>
</html>

UserPPREmail.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xht
Member 10584788 18-Oct-14 3:44am    
That is ok...i want the exact code which will be called on click of radio button ...and have created the SendEmail as a region in APIManager file in which i had written code below...and i m using three tier architecture of asp.net


#region Send UserPPR Email

private void SendUserPPREmail(string SenderName, string SenderEmail, string ReceiverName, string ReceiverEmail, string UserID, string CustomerID, string PPRTypeID, string CallTypeID, string PPID, string DivisionID, string ProductID, string ModelID, string Comments, string MachineSrNo, string PartComments,string HMR,string ExpWorking,string Category,string PartID,string Quantity,string CCEmails, string Date)
{
ListDictionary replacements = new ListDictionary();
replacements.Add("<%SenderName%>", SenderName);
replacements.Add("<%SenderEmail%>", SenderEmail);
replacements.Add("<%ReceiverName%>", ReceiverName);
replacements.Add("<%UserID%>", UserID);
replacements.Add("<%CustomerID%>", CustomerID);
replacements.Add("<%PPRTypeID%>",PPRTypeID);
replacements.Add("<%CallTypeID%>", CallTypeID);
replacements.Add("<%PPID%>", PPID);
replacements.Add("<%DivisionID%>", DivisionID);
replacements.Add("<%ProductID%>", ProductID);
replacements.Add("<%ModelID%>",ModelID);
replacements.Add("<%Comments%>",Comments);
replacements.Add("<%MachineSrNo%>",MachineSrNo);
replacements.Add("<%PartComments%>",PartComments);
replacements.Add("<%HMR%>",HMR);
replacements.Add("<%ExpWorking%>",ExpWorking);
replacements.Add("<%Category%>",Category);
replacements.Add("<%Part ID%>",PartID);
// replacements.Add("<%%>",);

//replacements.Add("<%RepairStatus%>", RepairStatus);
//replacements.Add("<%Amount%>", Amount == "" ? "N/A" : Amount);
//replacements.Add("<%ReceiptNo%>", ReceiptNo == "" ? "N/A" : ReceiptNo);
replacements.Add("<%Date%>", Date);

EmailManager.SendEmailUsingTemplate(SenderEmail, ReceiverEmail, "User PPR Report", Server.MapPath("EmailTemplates/UserPPREmail.txt"), replacements, ConfigurationManager.AppSettings["SmtpServerName"].ToString(), CCEmails);
}

#endregion


and also created the two extra files as UserPPREmail.txt and UserPPREmail.html in EmailTemplate

UserPPREmail.txt
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Hello <%ReceiverName%>,<br><br />
Please find below the details Of Parts Details - <%PPRID%><br /><br />

Date - <%Date%><br /><br />
PPR ID - <%PPRID%><br /><br />
User ID - <%UserID%><br /><br />
Customer ID - <%CustomerID%><br /><br />
PPR Type ID- <%PPRTypeID%><br /><br />
Call Type ID - <%CallTypeID%><br /><br />
PP ID - <%PPID%><br /><br />
Division ID - <%DivisionID%><br /><br />
Product ID - <%ProductID%><br /><br />
Model ID - <%ModelID%><br /><br />
Comments - <%Comments%><br /><br />
Machine SrNo - <%MachineSrNo%><br /><br />
Part Comments - <%PartComments%><br /><br />
HMR - <%HMR%><br /><br />
Exp Working-<%ExpWorking%><br /><br />
Category-<%Category%><br /><br />
Part ID-<%PartID%><br /><br />
Thanks,<br />
<%SenderName%><br />
Email - <%SenderEmail%><br />
</body>
</html>

UserPPREmail.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Hello <%ReceiverName%>,<br><br />

Please find below the details Of

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900