Thank you Ashish for responding.
I have concerted the output $txt to stream and then used “pub.mime:createMimeData” service and passing the stream variable(output of stringtostream) to input of “pub.mime:createMimeData”.
Then invoked "pub.mime:addBodyPart " service and passed the inputStream(output of stringtostream) to “content” object which is the input of addBodyPart service and set the IsENVStream as yes.
Then invoked the “pub.mime:getEnvelopeStream” to document “MIMEDATA” to input (doc-MIMEData) of the service and mapped the output of getEnvelopeStream service to smtp service’s mimeStream but still facing the same error “com.wm.util.Values cannot be cast to java.lang.String”
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods