How to retrieve the content of an email by polling?

Hi,

I am able to poll my email client and invoke the corresponding service. But in that service, I don’t know how to retrieve the content, subject of email. Please let me know if any of you have gone through this in your implementation.

Thanks in advance.

Regards,
Prasanna.

In the Service the body comes as an IData so get the cursor and read the payload.
If you want to check what is the content in the pipeline, call pub.flow.tracePipeline in your service.

email receive: (See ISAdministratorGuide.pdf)

* Go to Administrator webPage > Security > Ports > Add Port
* select webMethods/Email
* select default package to receive emails (or leave default WmRoot)
* enter email account info in Server Information section
* enter name of Default service eg: MyFolder:MyService
* email arrives in pipeline as object called "contentStream" so define an input object type for the service called "contentStream"
* use createMimeData to convert to IData object

          pub.mime.createMimeData (map contentStream to input)
          pub.mime.getBodyPartContent (part 0 = header, 1 = attachment)
          streamToBytes
          bytesToString
          savePipelineToFile
          etc...

Cheers,
Allen.

1 Like

Hi Allen,

I’ve tried the answer you’ve provided but the webMethods failed to get the email content.

Here is my pipeline result on the first step.
My email body only content “BODYtest 1 2 3”, however, the value has imported as an variable name instead of value.

<?xml version="1.0" encoding="UTF-8"?> /MRPFM/Pipeline.xml

Is that something wrong in my setting…

I’m having exactly the same issue; the pipeline does not appear to have any data from the email (Subject, from, to, etc) except for the text in the body, which is presented as a variable name. This is right up at the top of the flow, so it’s before the call to createMimeData.

Any ideas?

Thanks

Simon

I have done this successfully. I can’t send you the flow itself, but I am happy to share the HTML of the flows for your review.

Send me an email and I’ll return a zip with the web pages you can view locally.

I use PSUtilities to store a config parameter with the names of the reports that I expect and categorize the mail by the subject line. Depending on the report, I extract either the body or an attachment.

Howard
HNeuwirth-Hirsch@noblecorp.com

Hi,

Thanks for the response.

Please send me the HTML of the flow to this email id

prasannasa@hcltech.com

Regards,
Prasanna.

Hi Howard

I am facing the same issue and could not read the email body message. Could you please sharing how did you do that?

Please send the service if possible at
My email is: aamjad@lendersfc.com

Thanks
Ammad

Hi Howard,

Can you send the service that you used for this purpose to sudhakar.kagupati@hotmail.com

Regards,
Sudhakar

Hi hneuwirth-hirsch.13148,

I’m having a similar issue with the same. Could you pls shed some light & share a detailed view of how to resove the issue at shalinsingh7@gmail.com

Many Thanks

Hi Howard,
can you send me your code as well? I am having problem of reading the content of received email.
Thanks
@
zhang.alexi@gmail.com

Hi Guys,

I am also stuck in extracting email body content.

Could anyone of you send the package zip at amit6098@gmail.com;

Thanks,
amit

Dude, Look at the code I developed for TMS back in 2010…

Hi Howard,
can you send me your code as well? I am having problem of reading the content of received email/emails to samermg@hotmail.com

Thanks

Hi Howard,

I’m having a similar issue with the same. Could you please shed some light & share a detailed view of how to resolve the issue at sandeep.lati@gmail.com

Many Thanks

Hi Howard,
can you send me your code as well? I am having problem of reading the content of received email/emails shaffimca39@gmail.com