Query regarding POP3 adapter

Hello,

Please help me in understanding how to use POP3 adapter as I am using it for the first time. I have to receive the email using POP3 and send the name of the attachment  in the email as the filename through SFTP adapter. Please suggest me if can do it in pipeline component, If yes then how.

Waiting for your reply.

Thanks in advance.

Regards,

Ranjana

August 29th, 2015 2:06am

Hi ,

POP3 configuration is easy one ,so dont need to worry . You can go through the walkthrough to create POP3 receive location

Walkthrough: Creating a BizTalk Application That Uses the POP3 Adapter

Then go with POP3 Receive location configuration

How to Configure a POP3 Receive Location

once done you can do the email attachment processing of the incoming message through POP3 adapter inside Orchestration


http://blog.vertica.dk/2011/01/14/processing-multiple-email-attachments-with-biztalk-server-2009-using-pop3-adapter-and-orchestration/


For getting attachment  in the Pipeline component and reading the name sample code can be downloaded from https://code.msdn.microsoft.com/BizTalk-ServerHow-to-63a7167a

The detailed description is available over techNet wiki article written by Suleiman

http://social.technet.microsoft.com/wiki/contents/articles/21001.biztalk-server-how-to-extract-email-attachments-by-pipeline.aspx

Thanks

Abhishek

Free Windows Admin Tool Kit Click here and download it now
August 29th, 2015 2:42am

Hi Ranjana,

The scenario you were asking

Once after successfully receiving the messages, from the Message context you can read file name using pipeline component.

Getting the properties of a file attached to an email message in pipeline components

You read by part name or actual file name.

public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
var partName = string.Empty;
// we start from index 1 because index zero contains the body of the message
// which we are not interested
for (int i = 1; i < inmsg.PartCount; i++)
{
var currentPart = inmsg.GetPartByIndex(i, out partName);
var attachmentFileName = currentPart.PartProperties.Read("FileName", "http://schemas.microsoft.com/BizTalk/2003/mime-properties");
var outMsg = pc.GetMessageFactory().CreateMessage();
outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
outMsg.Context = PipelineUtil.CloneMessageContext(inmsg.Context);
outMsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", attachmentFileName);
_msgs.Enqueue(outMsg);
}
}
public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
var partName = string.Empty;
// we start from index 1 because index zero contains the body of the message
// which we are not interested
for (int i = 1; i < inmsg.PartCount; i++)
{
var currentPart = inmsg.GetPartByIndex(i, out partName);
var outMsg = pc.GetMessageFactory().CreateMessage();
outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
outMsg.Context = PipelineUtil.CloneMessageContext(inmsg.Context);
outMsg.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", partName);
_msgs.Enqueue(outMsg);
}
}

Blogs / Resources for understanding the POP3 flow.

You can go through below articles for understanding the basic flow, handling flow.

How to configure POP3 adapter to receive messages from outlook.com in BizTalk

Biztalk POP3 Adapter Sample

BizTalk Server POP3 adapter

POP3 Sample Document

Email-attachments-in-biztalk-2006.

Thanks, SMSVikasK

August 29th, 2015 3:21am

Hi Ranjana,

Refer below threads for issues and resolutions.

Since you are updating the file name to context in SFTP send port you should use below macro,

SFTP send port macro : %SourceFileName%

BizTalk Server: How to Extract Email Attachments By Pipeline

https://social.msdn.microsoft.com/Forums/en-US/edf9eada-f30a-4581-96ed-1abcd9f923ff/biztalk-2010-pop3-attachement-pipeline-filename-issue?forum=biztalkgeneral#52b6e0ae-dbf6-4d50-bf63-6ddfcccd575b

Thanks, SMSVikasK

Free Windows Admin Tool Kit Click here and download it now
August 29th, 2015 3:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics