| Author | 
		  Message
		 | 
		
		  | biswagourab | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 7:42 am    Post subject: MB 6.1 Email Node | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 31 May 2005 Posts: 47 Location: London 
  | 
		  
		    
			  
				Hi 
 
    I have a flow which has 3 nodes. 
 
MQInput --> Compute --> EmailOutput
 
 
I was curious if we can set the body of the email in the compute node. I am able to set the Header of the email and the SMTP server values, but somehow am not able to do the same for the email body. 
 
 
I did see the sample that came along with the package, and it implements Java, and does infact build the email body in the Compute node itself. 
 
 
But I wanted to do that using ESQL. 
 
 
The IBM help says "If you do not specify a value for the MessageText property, the text of the e-mail is the body of the message tree that is passed to the EmailOutput node"
 
 
But I am not able to understand 'body of the message tree'    
 
 
Can anyone please help me on this. 
 
 
Thanks 
 
Biswa _________________ _________________
 
Biswa Gourab Malla 
 
IBM Certified System Administrator - WebSphere MQ, v6.0
 
IBM Certified System Administrator - Websphere Message Broker v6.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 7:48 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				The Body of the Message Tree is "OutputBody".  Which is to say "the last child of OutputRoot".
 
 
I.e. - whatever your message tree has.
 
 
So if you build OutputRoot.XMLNSC with a valid XML document, and pass that to EmailOutput node, then the body of the email message will be the XML document.  Likewise with a TDS document or SOAP or other domain. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | broker_new | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 8:15 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Yatiri
 
 Joined: 30 Nov 2006 Posts: 614 Location: Washington DC 
  | 
		  
		    
			  
				Try this it worked for me in WMB 6.0.3.
 
 
SET OutputRoot.XMLNSC.Message.From     = 'abcd@abcd.com';
 
SET OutputRoot.XMLNSC.Message.To         = 'abcd@abcd.com'';
 
SET OutputRoot.XMLNSC.Message.Subject  = 'Hi';
 
SET OutputRoot.XMLNSC.Message.Body      = 'Test Mail to test the SendMailPlugIn Node functionality'; _________________ IBM ->Let's build a smarter planet | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 8:20 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				
   
	| broker_new wrote: | 
   
  
	| Try this it worked for me in WMB 6.0.3. | 
   
 
 
 
Which of course uses the sendmail plugin node SupportPac.
 
 
Which is entirely unrelated to the EmailOutput node in v6.1. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | broker_new | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 8:27 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Yatiri
 
 Joined: 30 Nov 2006 Posts: 614 Location: Washington DC 
  | 
		  
		    
			  
				oops I had mistaken i thought EmailOutputNode is SendMailPluginNode.
 
I didn't know that there is such node.
 
I have to look at 6.1 documentation to understand the new features. _________________ IBM ->Let's build a smarter planet | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | biswagourab | 
		  
		    
			  
				 Posted: Tue Apr 15, 2008 3:56 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 31 May 2005 Posts: 47 Location: London 
  | 
		  
		    
			  
				Thanks jefflowrey
 
 
I did as you suggested, and set the 'OutputBody' as 
 
SET OutputRoot.XML.Email.MessageText = InputRoot.XML.Envelope.Body.Message;
 
 
And it did capture the data, and send out an email. but not in the format that I was expecting. It looked like this 
 
<Email><MessageText>Test Message</MessageText></Email>
 
 
Then I set the 'Body Content Type' of the EmailOutput node from 'Text/Plain' to 'Text/HTML' and then it came out fine. 
 
 
Thanks for the help    
 
Biswa _________________ _________________
 
Biswa Gourab Malla 
 
IBM Certified System Administrator - WebSphere MQ, v6.0
 
IBM Certified System Administrator - Websphere Message Broker v6.0 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | murdeep | 
		  
		    
			  
				 Posted: Thu May 15, 2008 6:58 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 03 Nov 2004 Posts: 211
  
  | 
		  
		    
			  
				I'm in the process of converting our flows that use sendmail to use the emailoutput node. 
 
 
I have a question on how to handle newlines in the body of the email. Sendmail had the concept of lines within the email boody. I am trying to do this in the emailoutput node but all of my email content appears as a single line. 
 
 
Can someone enlighten me on how to get two or more lines within the email body? I've tried adding CRLF chars but they appear to be ignored. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | murdeep | 
		  
		    
			  
				 Posted: Thu May 15, 2008 3:27 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 03 Nov 2004 Posts: 211
  
  | 
		  
		    
			  
				Ok, since the email body is actually html I though I would construct an html doc and see what happens and sure enough it worked. For example here is the sample ESQL I used:
 
 
   
	| Code: | 
   
  
	      SET OutputRoot.EmailOutputHeader.Subject = 'This email is from broker ' || BrokerName;
 
      SET OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/html';
 
      SET OutputRoot.XMLNSC.Email.H2 = 'Heading in the body';
 
      SET OutputRoot.XMLNSC.Email.BR[1] = 'Some text in the body';
 
      SET OutputRoot.XMLNSC.Email.BR[2] = 'Some more text in the body'; | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Gemz | 
		  
		    
			  
				 Posted: Fri May 16, 2008 12:51 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 14 Jan 2008 Posts: 124
  
  | 
		  
		    
			  
				You can pass the entire email message as a character to email node.
 
 
Its something like
 
 
   
	| Code: | 
   
  
	SET OutputRoot.XMLNSC.MailMsg = '
 
Admin,
 
blah blah blah
 
Flow Name : '||Environment.Variables.FLOWID||'.
 
Unique Id : '||Environment.Variables.uniqueID||'.
 
Error Text : '||Environment.Variables.ErrorText; | 
   
 
 
 
In this we are sending the message as an xml with single element. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |