You need to sign in to do that
Don't have an account?
rupesh ranjan
After sending mail Body(Ckeditor) are coming with HTML tag. How to Remove???
After sending mail Body(Ckeditor) are coming with HTML tag. How to Remove???
Visual force page <apex:pageBlock > <apex:commandButton value="Send" action="{!send}" /> </apex:pageblockSection> <apex:outputLabel value="AddRecep" for="AddRecep"/>:<br/> <apex:inputText value="{!AddRecep}" id="table2"/> <apex:commandlink onclick="openPopup();return false;" value="Add Recipients" /> <br/><br/> <br><apex:outputLabel value="From" for="From"/>: {!$User.FirstName} {!$User.LastName} </br> <br/><br/> <apex:outputLabel value="Subject" for="Subject"/>:<br/> <apex:inputText value="{!subject}" id="Subject" maxlength="80"/> <br/><br/> <apex:outputLabel value="Choose Video "/> <apex:outputLink onclick="showpopup(); return false;" > <br/> Click here to choose session </apex:outputLink> <br/><br/> <apex:outputLabel value="Body" for="Body"/>:<br/> <!--<apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" />--> <apex:inputtextarea value="{!body}" id="body" styleClass="ckeditor" richtext="false" style="width: 500px; height: 150px;"> </apex:inputtextarea> <br/><br/><br/> <apex:includescript value="{!URLFOR($Resource.CkEditor,'ckeditor/ckeditor.js')}"/> </apex:pageblock>
Controller public pageReference send(){ Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); List<String> toAddress =new List<String>(); if (AddRecep != '' && AddRecep != null) { toAddress = AddRecep.split(';'); email.setToAddresses(toAddress); email.setSubject(subject); email.setPlainTextBody(body); Messaging.SendEmailResult [] res = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email}); for ( Messaging.sendEmailResult result : res ) { if ( !res[0].isSuccess () ) { System.debug ( result ); } else{ ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' ); ApexPages.addMessage(msg); } } } return null; } public List<video> ConsoleWrapperList1{get;set;} public String consolewrap{get;set;} public void callapi2(){ String SessionId = ''; for( consolewrap cwt : ConsoleWrapperList){ if(cwt.selected){ if(SessionId == ''){ SessionId += cwt.sid; }else{ SessionId += ','+ cwt.sid; } } } List<video> ConsoleWrapperList1 = new List<video>(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); req.setEndpoint('http://webapi.demomail.net/test/SendVideoBody.js?id='+SessionId); req.setMethod('GET'); res = http.send(req); if(res.getstatusCode() == 200 && res.getbody() != null){ String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','').replace('',''); ConsoleWrapperList1=(List<video>)System.JSON.deserialize(replaceIllegal,List<video>.class); body = ConsoleWrapperList1.get(0).bodyT; }
If I understand problem correctly you are sending plain text email. Why do you use CKEditor instead of textarea?
Anyway it is possible to get text without HTML tags.
You have to get text in JavaScript and send it to controller via action function: