Reputation: 258
I have a website, published here.
On the contact us page, linked above, there is a drop down menu.
Depending on the selection of the content type in that menu, a different person is emailed.
The original developer, apparently to my inexperienced eyes at least, hardcoded the email addresses for those people.
Several of them have left the company, and we are maintaining their email addresses and checking them solely for the purpose of these web contacts.
Ideally, I would like to set up a control on the website admin page to allow the addresses to be edited in the future.
I can see and edit the contact us page in VS 2010 (currently using web matrix and VS 2010 Express but I have VS 2010 Professional as well.)
My experience is very limited, so I will have to learn a lot, I expect, to make this happen.
Enough background, I hope. What I need is to find where the emails are coded. The dropdown shows a identifier which relates to the selected choice, but I can't find what that relates to, or what control relates it to an email (or where it posts to when "Send" is clicked.)
I apologize in advance for my lack of knowledge. I'm trying to learn, and I have a job to do. I'll try not to suck up too much of anybody's time, and I'll try to work out on my own, what I can. Please let me know what further data I can provide.
This is the code for the dropdown. If there is a reference here to where the data I need is, I can't find it. I can post the rest of the code for the page if necessary.
EDIT: I posted the whole page. The dropdown seemed too basic to be of help.
EDIT: Posted source code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Mail;
public partial class ContactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Calendar cal = new Calendar();
string dat = cal.TodaysDate.Date.ToLongDateString();
System.Web.Mail.MailMessage mm = new MailMessage();
mm.From = "WBS Website<[email protected]>";
if (DrpDwnType.SelectedItem.Value == "G")
mm.To = "[email protected]";
else
mm.To = "[email protected]";
mm.Cc = "[email protected]";
mm.Bcc = "[email protected]";
mm.Subject = "Online comments from WBS website visitor, " + TXTFname.Text;
mm.Body = "<div style='border:solid 2px RED; padding:25px 25px 25px 25px'><br><br> <strong>Online comments from WBS website</strong><br> <br> ------------------------------------- <br> Date : " + dat + "<br> <br> First Name : " + TXTFname.Text + "<br>Last Name : " + TXTLastName.Text + "<br> Email Address : " + TXTEmail.Text + "<br> Contact No : " + TXTMob.Text + "<br> Enquiry Type : " + DrpDwnType.SelectedItem.Text + "<br> <br> <br> The visitor comment : <br> --------------------------------------- <br> " + TXTComment.Text + "</strong><br><br>Further Information : " + RadioButtonList1.SelectedItem.Value.ToString() + "<br><br><br></div>";
mm.BodyFormat = MailFormat.Html;
SmtpMail.Send(mm);
TXTFname.Text = "";
TXTLastName.Text = "";
TXTMob.Text = "";
TXTComment.Text = "";
TXTEmail.Text = "";
TXTMess.Text = "Thank you for your interest in WBS!!! ";
}
}
Upvotes: 1
Views: 7811
Reputation: 9181
Seriously, the best advice I can give you is to contract a new developer to help you out.
What happens when the production system stops working because it was not tested or deployed properly? Its likely no one here can help you then because they cannot see all the details of your system's configuration, and you'll find yourself under even more time pressure to solve the new problem, with users getting upset with you.
Upvotes: 3
Reputation: 66389
In the BIN folder of the website on the web server you will find one or more DLL files.
Those files can be "decompiled" to their source code using tools such as ILSpy.
After decompiling the whole code search for the keyword "DrpDwnType" and you should see where the email addresses are hard coded. After compiling it again you should be able to update the DLL files on the website to reflect the changes.
Upvotes: 2