|
Home > Archive > BizTalk Server General > January 2006 > Biztalk 2006 & POP3
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Biztalk 2006 & POP3
|
|
|
| Has anyone used the POP3 adapter with Biztalk 2006? I'm trying to get the
subject of the email and rename the attachment to this, before saving the
file to afile.
I can get the POP3 adapter to retrieve the message - but can't access the
attachment or message properties. How can I access the subject and
attachment? Is there a specific schema file I should be loading up? The
attachment will be a gif or pdf ....
Thanks!
Kev
| |
| Matt Meleski 2006-01-24, 6:04 pm |
|
To get the Subject of the email, in an orchestration:
strSubject = MyIncomingEmailMessage(POP3.Subject)
If you have only one attachment in your Email then in the
POP3 Receive Location Properties:
1) Set Apply MIME Encoding = True
2) Set Body Part Index = 2
3) Leave Body Part Content Type Blank
The attachment should then be published into the messagebox
If have more than one attachment in your email:
To get the attachment, first let the message come through with the
the Receive Location POP3 Adapter Setting -> Apply MIME Encoding = False
Then create a File Send port that subscribes to the POP3 Receive Port with
a filter with something like :
BTS.ReceivePortName = MyPOP3ReceivePort
Then go to the file directory where the MIME encoded message was dropped off
by the Send Port and open it up in notepad.
Find the attachement in the message and then look for the attachement
section :
Content-Type:
Copy out the Content Type: For example for a word document it might look
like : application/msword
Then go back to the POP3 Receive location and :
1) Set Apply MIME Encoding = True
2) Set Body Part Content Type = application/msword
That attachment should then be published in the MsgBox
Matt
"Kev" wrote:
> Has anyone used the POP3 adapter with Biztalk 2006? I'm trying to get the
> subject of the email and rename the attachment to this, before saving the
> file to afile.
> I can get the POP3 adapter to retrieve the message - but can't access the
> attachment or message properties. How can I access the subject and
> attachment? Is there a specific schema file I should be loading up? The
> attachment will be a gif or pdf ....
>
> Thanks!
>
> Kev
| |
| Steve Harclerode 2006-01-24, 8:53 pm |
| Is there a way similar to this to get the actual body of the message? I'd
like to be able to use it. In my case, the email itself is plain text, and
the attachment is XML.
(I already am succesfully processing the XML attachment).
Thanks,
Steve
"Matt Meleski" <MattMeleski@discussions.microsoft.com> wrote in message
news:2FDDEEB8-F91F-4C46-BE1D-062D3DEA8EF0@microsoft.com...
>
> To get the Subject of the email, in an orchestration:
>
> strSubject = MyIncomingEmailMessage(POP3.Subject)
>
> If you have only one attachment in your Email then in the
> POP3 Receive Location Properties:
>
> 1) Set Apply MIME Encoding = True
> 2) Set Body Part Index = 2
> 3) Leave Body Part Content Type Blank
>
> The attachment should then be published into the messagebox
>
| |
| Matt Meleski 2006-01-27, 9:28 pm |
| Steve,
One way to do this is to let the Encoded MIME message come into an
orchestration, and then execute a series of Receive Pipelines in the
orchestration to extract the different parts of the email message as
explained below:
1) On your POP3 Receive Location Adapter Properties :
Set the Apply MIME Decoding property = False
2)
i) In a BizTalk Project, add a receive Pipeline (Can call it
ReceivePipelineBody)
and then drag a MIME/SMIME decoder from the toolbox into the Decode Section
of the Receive Pipeline.
For the properties of the MIME/SMIME decoder, set the :
Body Part Index = 0
This will extract out the Body part of the message
ii) In the same BizTalk Project, add a receive Pipeline (Can call it
ReceivePipelineAttachement)
and then drag a MIME/SMIME decoder from the toolbox into the Decode Section
of the Receive Pipeline.
For the properties of the MIME/SMIME decoder, set the :
Body Part Index = 2
This will extract out the Attachement part of the message
iii) Add an orchestration to the BizTalk project and then have it
Receive the initial Encoded message from the Receive Port/Location discussed
in 1).
In this Orchestration add a Expression shape with something like the below
to execute the receive Pipelines to extract out the different parts of the
Email message :
// First get the attachement.
varPipelineOutPutMessages =
Microsoft.XLANGs.Pipeline.XLANGPipelineManager. ExecuteReceivePipeline(typeof(Mod1BizTal
k.ReceivePipelineAttachment), msgEmail);
varPipelineOutPutMessages.MoveNext();
construct msgAttachement
{
msgAttachement = null;
varPipelineOutPutMessages.GetCurrent(msgAttachement);
}
// Next get the body of the message
varPipelineOutPutMessages =
Microsoft.XLANGs.Pipeline.XLANGPipelineManager. ExecuteReceivePipeline(typeof(Mod1BizTal
k.ReceivePipelineBody), msgEmail);
varPipelineOutPutMessages.MoveNext();
construct msgBody
{
msgBody = null;
varPipelineOutPutMessages.GetCurrent(msgBody);
}
If looking for an example on how to execute a Receive Pipeline in an
orchestration.
there is an example in the BizTalk 2006 SDK as here:
C:\Program Files\Microsoft BizTalk Server
2006\SDK\Samples\Pipelines\ComposedMessa
geProcessor
Matt
"Steve Harclerode" wrote:
> Is there a way similar to this to get the actual body of the message? I'd
> like to be able to use it. In my case, the email itself is plain text, and
> the attachment is XML.
> (I already am succesfully processing the XML attachment).
>
> Thanks,
> Steve
>
> "Matt Meleski" <MattMeleski@discussions.microsoft.com> wrote in message
> news:2FDDEEB8-F91F-4C46-BE1D-062D3DEA8EF0@microsoft.com...
>
>
>
| |
|
| Thanks Matt, worked like a charm!
"Matt Meleski" wrote:
[vbcol=seagreen]
>
> To get the Subject of the email, in an orchestration:
>
> strSubject = MyIncomingEmailMessage(POP3.Subject)
>
> If you have only one attachment in your Email then in the
> POP3 Receive Location Properties:
>
> 1) Set Apply MIME Encoding = True
> 2) Set Body Part Index = 2
> 3) Leave Body Part Content Type Blank
>
> The attachment should then be published into the messagebox
>
> If have more than one attachment in your email:
>
> To get the attachment, first let the message come through with the
> the Receive Location POP3 Adapter Setting -> Apply MIME Encoding = False
>
> Then create a File Send port that subscribes to the POP3 Receive Port with
> a filter with something like :
> BTS.ReceivePortName = MyPOP3ReceivePort
>
> Then go to the file directory where the MIME encoded message was dropped off
> by the Send Port and open it up in notepad.
>
> Find the attachement in the message and then look for the attachement
> section :
> Content-Type:
>
> Copy out the Content Type: For example for a word document it might look
> like : application/msword
>
> Then go back to the POP3 Receive location and :
> 1) Set Apply MIME Encoding = True
> 2) Set Body Part Content Type = application/msword
>
> That attachment should then be published in the MsgBox
>
> Matt
>
> "Kev" wrote:
>
|
|
|
|
|