Receive email in WM 6 not able to use text in body of mail

Hi, I’ve created a port to receive e-mails and it works fine when I want to read the attachements but I cannot use the body of the mail. I use the service in wmPublic.pub.flow:getTransportInfo. Is there a different service I can use because none of the outputs of this service gives me the body of the mail as an output. The body of the mail actually comes through as the name of the content field and I cannot work with it there. Please advise.

Thanks
Rudi

Convert u r contentstream to string using “steamtostring” built in servie.

Thanks for the swift response, I’ve tried what you’ve said before but it does not work. The problem is that if you look at the output of the getTransportInfo service, the name of one of the output fields is equal to the body of the mail and its value is null. So if I map it, I am mapping the null, not the actual text. In the documentation I have, the content field is the contents of the attached file, not the mail body. I have written the pipeline to file for you to see. The mail body starts with the word: “START”.

Thanks


Email pipeline to file.txt (0.7 k)

Hi Jordaan,
I was unable to find the problem in u r case,I look into the what u sent and there is no value for the data.Send more details like what is the input u r passing and steps before calling the gettransportinfo service.
Thanks,
Mahesh L

Hi Mahesh, there is no steps before the gettransportinfo service. All I do is call the default service when I receive the mail and there is just two steps in the service, gettransport info and then savepipeline to file. All I want is the body of the mail in the pipeline, but it does not seem that gettransportinfo can do this. Maybe there is another service that pass the mail body to the pipeline.

Cheers

If your sender is sending an Edi document as email attachment then they should set content-type as “application/EDI” while sending to your wM server and your dedicated service input should be ediByteArray (case sensitive).

Or if it is xml attachment then content-type should be “text/xml”,so that webMethods can read (xmldata) and process the request to appropriate service input (use input as Stream or $xmldata).

During this invocation pls do keep savepipeline and restorepipeline as a first step in the target service for testing,and invoke debuglog service for more detail tracing…

HTH.

It is not an attachment that I am trying to receive, I want the normal text body of the e-mail in the pipeline, that’s all.

Then you should be able to see in pipeline,invoke debuglog in your target service and try to trace it in serverlog (increase level between 5-9).

HTH.

When I upload the file to the pipeline again, I can see the mail body, but it is not as a value to a field, instead it gives the mail body as a field name in the output and I cannot use it. I have attached the file for you if you want to have a look at it. The body of the mail is:“THIS IS THE MAIL BODY”. You will see that in the file this is set as <null> which cannot be used as it is not data in the pipeline but rather a field name. I cannot map the field because the field “THIS IS THE MAIL BODY” has a value of null in the pipeline. Do you maybe know of a different service I can use?

Thanks for the assistance, it is greatly appreciated.

Hi Rudy,
I have always used a variable name in body of the email to get the value, thats how WM content handler is written. There is also a limit in content handler, it reads only 4096 bytes and after that it truncates because 4096 bytes is hard coded in the content handler. I will suggest to use attachments if you think your data will be more then 4096 bytes in the email body.
But if you have a requirement that it has to be email body then you might need to write a content handler according to your requirement.

Cheers

Thanks Manish,
I’ve got an integration in the WM Enterprise Edition 4.5 that I have to convert to WM 6 so I have to use the body of the mail as it currently is. The company we integrate with sends an encrypted mail to us and if we want it as an attachment they will ask us additional developing costs which is not an option. It is just hard to believe that the previous version of webMethods have functionality that can easily handle huge volumes in the body of an email in a very simple configured operation and the new version 6 doesn’t. Are you sure there is no existing services in version 6 that WM support that can do this?

Did you ever get a resolution to your problem? I’m having the same issue…can’t get the body of the email…

Rudi, from what I have experienced with SAP Business Connector 4.6 (same as B2B Integration Server 4.6 I believe), if the sending mail client has encoded the email as a multipart/mixed message (i.e. multiple MIME payloads in the same email), each part is extracted by the content handler and passed to an independent invocation of the service attached to the email listener. What this means is that the body of the email is passed to your service as an attachment (although it may contain other artifacts).

If this is the case in the WebMethod’s version of this software, you may be able to extract the body text data in the same way as you do an attachment, although you may need to do some parsing of the information returned. If this works then the only other thing you need to take care of is terminating the service prematurely if the “attachment” you get is not the body text e.g. if someone using MS Outlook formats the email using HTML, you will get additional invocations of the service which try to process other “invisible” attachments such as GIF files etc.

Hope this is of some use to you.

Hi
can anyone pls send me the snapshot of email config…(urgent)\

thanks in advance
ranjith

Ranjit,

Here is sample Ports/Email listener configuration:

Package Name WmRoot or your custom Package

Server Information:
Host Name emailserverHost.com
Type IMAP
User Name inbound_test
Password **********
Time Interval (seconds) 1
Port (optional) unspecified
Log out after each mail check Yes
Security
Run services as user Administrator
Require authorization within message No

Message Processing:
Global Service (optional) receiveEmailServiceName
Default Service (optional) unspecified
Send reply email with service output No
Send reply email on error No
Delete valid messages (IMAP only) Yes
Delete invalid messages (IMAP only) Yes
Multithreaded processing (IMAP only) No
Number of threads if multithreading turned on 0
Invoke service for each part of multipart message Yes
Include email headers when passing message to content handler No

These above configuration settings may change depends on POP3 or IMAP.

HTH,
RMG.

HI RMG
I got the email body using getTransportInfo and savePipelineToFile
flow services.Now i want to fetch the content of the attachment file.
i am able to see the file name in the text file which i used to store the pipeline. But i dont know how to fetch the content of the attachment …for eg the attachment file is (testingFile.txt) and it contains some msg.Can u pls tell me the way…
thanks in advance
ranjith

HI RMG
I got the email body using getTransportInfo and savePipelineToFile
flow services.Now i want to fetch the content of the attachment file.
i am able to see the file name in the text file which i used to store the pipeline. But i dont know how to fetch the content of the attachment …for eg the attachment file is (testingFile.txt) and it contains some msg.Can u pls tell me the way…
thanks in advance
ranjith

Ranjit,

As i metioned before extract the contentStream object which will be in the pipeline and use savePipeline instead of savePipelineToFile(Since Streams will not be saved and dont show up when debugging).

Also make sure the content or contentStream object exists in the pipeline.

HTH,
RMG.

Ranjit,

As i metioned before extract the contentStream object which will be in the pipeline and use savePipeline instead of savePipelineToFile(Since Streams will not be saved and dont show up when debugging).

Also make sure the content or contentStream object exists in the pipeline.

HTH,
RMG.