Mohammed Atef’s Technical blog

BizTalk Server POP3 adapter

Introduction

We have a many business scenario for using emails with BizTalk, in this article I will begin with creating simple application for receiving Email using POP3 adapter then I will continue with receiving emails with attachment files.

Configures a BizTalk receive location

Suppose you need to receive email using Post Office Protocol 3 (POP3) Internet email server so you can follow the following steps

1-     Open the BizTalk Server 2006 Administration Console, and expand the BizTalk Application1 application or create new application and use the your application in the next steps.

2-     Under the BizTalk Application 1 application, right-click the Receive Ports folder, and
select New ➤ One-Way Receive Port.

3-     Add a receive location to the new receive port, and specify the POP3 transport type.

4-     Click the Configure button to open the POP3 Transport Properties dialog box.

5-     In the POP3 Server configuration section, enter the name of the POP3 Internet mail
server where BizTalk will receive messages, as shown in the below Figure.

BTSPOP3

BTSPOP3

6-     Under the security configuration section, select the appropriate value for the authentication scheme setting for the POP3 mail server.you can select the authentication schema based on this knowledge.
Basic: BizTalk passes the username and password to the POP3 mail server in clear text.
Digest: BizTalk computes a hash value of the username and password to send to the POP3 mail server
SPA: Secure Password Authentication (SPA) uses Windows credentials to authenticate with the POP3 mail server. Specify the username in the format <domain>\<username>, or <machine name>\<username> if using a local account.

7-     Specify the User Name property value. Some POP3 mail servers require the domain information, shown as matef@bts.com.

8-     Select the Password property, and click the ellipsis to expose the password control.
Enter the password for the username specified.
BizTalk will now detect and receive messages sent to the matef@bts.com email address.

Receiving of mail with attachment

Now we are going to learn how to receive the e-mail with data contained in the attachment.so you can follow this steps
1- create new orchestration contains one receive port, one receive shape, one construct message shape, one send shape and one send port. This orchestration should receive the e-mail, extract the data contained in attached file and save it on the disk.

2- Now create one Mulipart Message AttachmentIn which contains two nodes: Attachment and Body.
Note:It is important that both nodes have to be of type XmlDocument. This is an interesting point, because the attachment can be a ZIP file, which contains only binary data.

3- When the POP3 adapter receives the message, the mail is parsed into multiple message parts. For example, if one e-mail has only body text, it is stored in message with one message part, called body message part. However, if the message has two attachments, then the message contains three message parts: One for body and one for each attachment.

4- After multipart message is prepared create two messages as shown at the next picture: MessageIn and MessageOut. The MessageIn is of type AttachmentIn, and MessageOut is of type XmlDocument.

5- Configure now the receive side to receive the MessageIn, which is of type AttachmentIn, configure the send port to send the message MessageOut, which is of type XmlDocument.

6- Now use the construct shape of type “MessageAssignemt” to create the message of type MessageOut (XmlDocument). In the expression editor type following:

MessageOut = MessageIn.Attachment;

 7- Now build and deploy the project. Open BTS Console and create the corresponding receive port and location as we mention in the beginning of the article, which will receive the mail with attachment. Remember that the used pipeline is PassThruReceive.

Hope this help.

Advertisements

May 28, 2009 - Posted by | Biztalk | , ,

8 Comments »

  1. Oh my goodness! Incredible article dude! Thank you so
    much, However I am encountering troubles with your RSS. I don’t understand why I am unable to subscribe to it. Is there anybody having similar RSS issues? Anybody who knows the answer will you kindly respond? Thanks!!

    Comment by Additional Info | July 3, 2013 | Reply

  2. Simply wish to say your article is as amazing. The clarity in your post is just great and i can assume you’re an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please carry on the enjoyable work.

    Comment by showthelyrics.blogspot.com | July 6, 2013 | Reply

  3. Great information. Lucky me I ran across your site by chance (stumbleupon).
    I’ve book marked it for later!

    Comment by best wedding video firm | July 23, 2013 | Reply

  4. Thank you for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups
    thanks once again.

    Comment by Los Angeles Video Production | August 3, 2013 | Reply

  5. Good article..!

    Comment by suresh | August 13, 2014 | Reply

    • thanks

      Comment by mohammedatef83 | August 13, 2014 | Reply

  6. Thorn of Girl

    Very good data is often identified on this web blogging site.

    Trackback by carmen yellow | August 16, 2014 | Reply

    • thank you

      Comment by mohammedatef83 | August 16, 2014 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: