Click here to Skip to main content
16,016,760 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..!

I have xslt code that displays staff information, on that information i want to add a textbox that will allow a user to change email. The user must then click the Send Notification button that will send an email to notify me that the email of that user has been changed

here is my xslt code:
XML
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">


XML
<table>
            <tr>
              <th>Staff Details</th>
            </tr>
            <tr>
              <th class="th" align="center">Details as stored on ITS: </th>
            </tr>
          </table>
        </div>
      </div>

        <table>
          <xsl:for-each select="EmployeeBio">
            <tr>
              <td>
                <b>Staff Number:</b>
              </td>
              <td>
                <xsl:value-of select="EmployeeID"/>
              </td>
            </tr>
            <tr>
              <td>
                <b>Surname:</b>
              </td>
              <td>
                <xsl:value-of select="LastName"/>
              </td>
            </tr>
            <tr>
              <td>
                <b>Names:</b>
              </td>
              <td>
                <xsl:value-of select="Name"/>
              </td>
            </tr>
            <tr>
              <td>
                <b>Initials:</b>
              </td>
              <td>
                <xsl:value-of select="Initials"/>
              </td>

XML
<tr>
              <td>
                <b>Email:</b>
              </td>
              <td>
                <xsl:value-of select="Email"/>
              </td>
            </tr>

XML
<tr>
              <td>
                <b>New Email:</b>
              </td>
              <td>
                <input type="text" id="txtNewMail" />
              </td>
            </tr>
XML
<tr>
              <td colspan="2">
                <center>
                  <a href="./SendNotification.aspx?Email={Email} &amp; newMail={txtNewMail}">
                    <input type="Button" value="Send Notification" />
                  </a>
                </center>
              </td>






I want to get the value of the textbox and use it to send an email
Here is the code to send the email:
C#
protected void Page_Load(object sender, EventArgs e)
        {

            using (MailMessage message = new MailMessage())
            {
                message.From = new MailAddress(Request.QueryString["Email"]);
                message.To.Add(new MailAddress("khumalon@tut.ac.za"));
               // message.CC.Add(new MailAddress("nxumalopp@tut.ac.za"));
                message.Subject = "Testing EmailUpDater project";
                message.Body = "The email: " + Request.QueryString["Email"] + " has been changed to: " + Request.QueryString["txtNewMail"];
                SmtpClient client = new SmtpClient();
                client.Host = "smtp.tut.ac.za";
                client.Send(message);
            }

            Label1.Text = "Notification sent";
        }
Posted

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