c# - Converting a string into a link in an email -


i trying send email supervisor when work order created

    if(textbox9.text=="quality"&&affectedrows==true)     {     boolislocal=httpcontext.current.request.islocal;     if(islocal==true)     {     system.net.mail.mailmessagenn=newsystem.net.mail.mailmessage();     nn.from=newsystem.net.mail.mailaddress("no_reply_workorder@mover.com");//whosend     nn.to.add(newsystem.net.mail.mailaddress("someone.something@mover.com"));      nn.subject="workorderstypequality";     httpfilecollectionuploadfiles=request.files;     for(inti=0;i<uploadfiles.count;i++)     {     httppostedfileuserpostedfils=uploadfiles[i];     try     {     if(userpostedfils.contentlength>0)     {     nn.attachments.add(newattachment(userpostedfils.inputstream,path.getfilename(userpostedfils.filename)));     }     }      catch     {     labelstatusmessage=(label)detailsview1.findcontrol("lblmessage");     statusmessage.text="uploadfailedpleasecontactdeveloper";     }     }     nn.body="donotreplytothisemail"+"<br><br/>"+"workordernumber"+":&nbsp;"+ "<ahref=\"http://localhost:49695/qualityreport.aspx?workordernum="+textbox13.text+"\">"+textbox13.text+"</a>"+"<-clickontheworkordernumberforreport"+"<br><br/>"+"workordernumber"+ ":&nbsp;"+"<ahref=\"http://localhost:49695/quality.aspx?workordernum="+textbox13.text+"\">"+textbox13.text+"</a>"+"<-clickontheworkordernumbertoenterdata"+"<br><br/>"+"requestor"+ ":&nbsp;"+textboxrequestor.text+"<br><br/>"+"date"+":&nbsp;"+ textboxdate.text+"<br><br/>"+"department"+":&nbsp;"+ textbox14.text+"<br><br/>"+"completiondate"+":&nbsp;"+ textboxcompletiondate.text+"<br><br/>"+"machinedescription"+ ":&nbsp;"+textboxmachinedescription.text+"<br><br/>"+ "machinelocation"+":&nbsp;"+textboxmachinelocation.text+ "<br><br/>"+"workrequired"+":&nbsp;"+textboxworkrequired.text+ "<br><br/>"+"status"+":&nbsp;"+textboxstatus.text;     nn.isbodyhtml=true;     system.net.mail.smtpclientclient=newsystem.net.mail.smtpclient();     client.host=configurationmanager.appsettings["smtpserver"];     captureuseremail();     }     } 

in body of mail sending link workorder got created, "http://server01/workorder/qualityreport.aspx?workordernum="textbox13.text+"\">" working on 4 different plants need deploy each project 4 servers , change link above server02, server03, , server04 , there 3 types of workorders thinking of storing each link key in web.config:

 <add key ="safetylink" value="http://server01/workordertool/safetyreport.aspx?workordernum="/> 

get value web.config , store string , use in email not sure how that:

 string safetylink = configurationmanager.appsettings["safetylink"];  mm.body = "do not reply email" + "<br><br/>" + "workordernumber" + ": &nbsp;" + "<a href=\"safetylink" + textbox13.text + "\">" 

but not work, doing above hope simple deploy 1 web application 4 servers , go each ones web.config , change name of server instead of find , replace.

thank in advance coders

thanks samiam anytime want sent string hyperlink in body of email:

use "<a href=\"" + yourstringname" 

Comments