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"+": "+ "<ahref=\"http://localhost:49695/qualityreport.aspx?workordernum="+textbox13.text+"\">"+textbox13.text+"</a>"+"<-clickontheworkordernumberforreport"+"<br><br/>"+"workordernumber"+ ": "+"<ahref=\"http://localhost:49695/quality.aspx?workordernum="+textbox13.text+"\">"+textbox13.text+"</a>"+"<-clickontheworkordernumbertoenterdata"+"<br><br/>"+"requestor"+ ": "+textboxrequestor.text+"<br><br/>"+"date"+": "+ textboxdate.text+"<br><br/>"+"department"+": "+ textbox14.text+"<br><br/>"+"completiondate"+": "+ textboxcompletiondate.text+"<br><br/>"+"machinedescription"+ ": "+textboxmachinedescription.text+"<br><br/>"+ "machinelocation"+": "+textboxmachinelocation.text+ "<br><br/>"+"workrequired"+": "+textboxworkrequired.text+ "<br><br/>"+"status"+": "+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" + ": " + "<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
Post a Comment