An alternative to using the POP3 adapter to read email attachments

Posted: October 1, 2008  |  Categories: BizTalk Uncategorized
Tags: BizTalk

What do you do if only have an SMTP server and POP3 server is not available?

1.     Install SMTP services on your BizTalk server.

2.     Configure the SMTP in IIS.

3.     Forward your incoming emails a user@<smtp server on BizTalk server>

4.     The incoming emails will be written to C:\Inetpub\mailroot\Drop if have configure the SMTP service to the defaults.

5.     Create a receive pipeline and add the standard MIME/SMIME decoder pipeline to the decode stage of the pipeline.

6.     Set the Body part content type to pick the part of the email that you want.

7.     Compile and deploy the pipeline.

 

mimepipeline1 

8.     Create a receive port and receive location that picks up *.eml from C:\Inetpub\mailroot\Drop

9.     Use the receive pipeline that you created in 5.

10.     Bind the receive port to a pass through send port.

11.     Start the ports and the hosts.

 

The eml file will be consumed and attachments will be written to the location specified in the send port.

Thus for this example eml file;

 

x-sender: AService@datacom.co.nz

x-receiver: markbr@markbr.datacom.co.nz

Received: from markbr ([172.20.12.163]) by markbr.datacom.co.nz with Microsoft SMTPSVC(6.0.3790.3959);

             Fri, 5 Sep 2008 14:28:45 +1200

Message-ID: <D2F1AEF9B1F354EBD350@datacom.co.nz>

From: “ASEService” <ASEService@datacom.co.nz>

To: <markbr@markbr.datacom.co.nz>

Subject: SunCountry Pick/Despatch File

Date: Fri, 5 Sep 2008 14:28:45 +1200

MIME-Version: 1.0

Content-Type: multipart/mixed;

            boundary=”—-=_NextPart_000_0064_01C90F63.B454E010″

X-Priority: 3

X-MSMail-Priority: Normal

X-Mailer: Microsoft Outlook Express 6.00.3790.3959

X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325

Return-Path: AService@datacom.co.nz

X-OriginalArrivalTime: 05 Sep 2008 02:28:45.0887 (UTC) FILETIME=[1F2704F0:01C90EFF]

 

This is a multi-part message in MIME format.

 

——=_NextPart_000_0064_01C90F63.B454E010

Content-Type: text/plain;

            format=flowed;

            charset=”iso-8859-1″;

            reply-type=original

Content-Transfer-Encoding: 7bit

 

Please find our pick/despatch file attached in csv format

 

Thank you

SunCountry NZ Ltd

 

——=_NextPart_000_0064_01C90F63.B454E010

Content-Type: application/vnd.ms-excel;

            name=”Bigcommafree.csv”

Content-Transfer-Encoding: quoted-printable

Content-Disposition: attachment;

            filename=”Bigcommafree.csv”

 

“443132”, 100,”12643″,”BRATTLES WALLY PARK”,”31-35 CRASSFIELD =

LANE”,”WALLY PARK”,”SOUTH SHORE”,”OAKLANDS”,”12643″,”BRATTLES WALLY =

PARK”,”3-5 CRASSFIELD LANE”,”WALLY PARK”,”SOUTH =

SHORE”,”OAKLANDS”,1,22/08/08,”AJS”,”GR6400″,        6.00,”EA”,”EASY =

PLAIN SNACK DOWN”,       35.00,      210.00,”4500009699″,     5595.20,   =

   699.40,     6294.60,”Y”,”443132″,”Y”,”P”,”S”,”01″=0A=

 

——=_NextPart_000_0064_01C90F63.B454E010—

 

If body part content type is set to application/vnd.ms-excel you get the following attachment text;

 

“443132”, 100,”12643″,”BRATTLES WALLY PARK”,”31-35 CRASSFIELD LANE”,”WALLY PARK”,”SOUTH SHORE”,”OAKLANDS”,”12643″,”BRATTLES WALLY PARK”,”31-35 CRASSFIELD LANE”,”WALLY PARK”,”SOUTH SHORE”,”OAKLANDS”,1,22/08/08,”AJS”,”GR6400″,        6.00,”EA”,”EASY PLAIN SNACK DOWN”,       35.00,      210.00,”4500009699″,     5595.20,      699.40,     6294.60,”Y”,”443132″,”Y”,”P”,”S”,”01″

 

If body part content type is left blank you get the following attachment text;

 

Please find our pick/despatch file attached in csv format

 

Thank you

SunCountry NZ Ltd

 

Once you have got the body part that you want in the pipeline you are ready to rock. Just add the correct flat file disassembler to convert the message to xml.

 

For alternative approaches see;

 

 

kennywest: Mime Decoder Pipeline Component in Biztalk 2004 (the solution)

 

 

turbo360

Back to Top