Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET POP3

 AfterLogic Forum : MailBee.NET POP3
Subject Topic: Parsing To field problems Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mrloofer
Newbie
Newbie


Joined: 19 December 2006
Location: United States
Online Status: Offline
Posts: 1
Posted: 19 December 2006 at 8:15pm | IP Logged Quote mrloofer

I use pop.net component to download emails from a catch all account and parse the To: address. This works fine until someone sends an email with more than one email address in the To: field. What happens is one email will be generated for each address in the To: field, however the To: field in each message will contain ALL the addresses instead of just one address. Not a Mailbee problem but is this a problem inhereted in POP? Does this also happen in SMTP?
Back to Top View mrloofer's Profile Search for other posts by mrloofer
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 20 December 2006 at 4:07am | IP Logged Quote Andrew

When you've composed a message in a mail client (like MS Outlook Express or MailBee.NET Objects) which contains some recipients' addresses in "To" field, the mailer sends it to the SMTP server (specified in mailer's configuration) through SMTP protocol. The SMTP server sends the message to each recipient separately, but doesn't change the contents of the "To" header and each recipient receives the message with the full recipients list in the "To" header. This behavior is standard for SMTP protocol.

POP3 protocol doesn't allow sending mail, it allows only downloading messages contained in certain mailbox on a POP3 server. Thus, this behavior doesn't relate to POP3 protocol at all.

Which problem did you encounter during parsing contents of the "To" field? MailMessage.To property isn't a simple string, it's a collection with great functionality. You can get all information about addresses in "To" field as follows (C# syntax):

Code:
// Create new MailMessage object.
MailMessage msg = new MailMessage();

// Load message from file (replace this line with your own code)
msg.LoadMessage(@"C:\TestMail.eml");

// For every recipient...
foreach (EmailAddress adr in msg.To)
{
    // Show full information about the recipient's e-mail address.
    Console.Write("Recipient name: " + adr.DisplayName);
    Console.Write("Recipient address: " + adr.Email);
    Console.Write("Recipient info: " + adr.Remarks);
    Console.Write("Account name: " + adr.GetAccountName());
    Console.Write("Domain name: " + adr.GetDomain());
}



Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide