Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Parsing From from EML Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
lukapor
Newbie
Newbie


Joined: 21 June 2023
Location: Slovenia
Online Status: Offline
Posts: 3
Posted: 21 June 2023 at 3:34am | IP Logged Quote lukapor

That was tested by library MailBee.NET version 12.3.1

in eml was property from formated like this
From: =?utf-8?Q?=20E-Signature via Docu?= ,--<info@info.com>

Loading eml was succeded but in propety From I got
From.Email = "E-Signature via Docu"
From.DisplayName = null

excepted value should be
From.Email = "info@info.com"
From.DisplayName = "E-Signature via Docu"

Back to Top View lukapor's Profile Search for other posts by lukapor
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 21 June 2023 at 3:46am | IP Logged Quote Alex

Hi,

That's incorrect formatting. Putting this From value into .EML and opening the resulting email in Mozilla Thunderbird shows some weird results.

This is because "," (comma) separates email addresses. If you remove the comma, the results could be different.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
lukapor
Newbie
Newbie


Joined: 21 June 2023
Location: Slovenia
Online Status: Offline
Posts: 3
Posted: 21 June 2023 at 7:33am | IP Logged Quote lukapor

Thats correct from can be email address list.

One question.
From property should be EmailAddressCollection. (same type as To property)

maybe
From should be populate as first valid email address?
Back to Top View lukapor's Profile Search for other posts by lukapor
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 21 June 2023 at 8:57am | IP Logged Quote Alex

Well, you can try something like
Code:

// Just an example of how eac can be initialized. You probably already have that object.
EmailAddressCollection eac = new EmailAddressCollection("=?utf-8?Q?=20E-Signature via Docu?= ,--<info@info.com>");
foreach (EmailAddress addr in eac)
{
     if (Smtp.ValidateEmailAddressSyntax(addr.Email))
     {
          msg.From = addr;
     }
}


So it iterates through email list and finds that one which is a real email address, and uses it then.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 21 June 2023 at 8:58am | IP Logged Quote Alex

You can add 'break' statement to always use the first valid found address. But I guess there will be just the one anyway.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
lukapor
Newbie
Newbie


Joined: 21 June 2023
Location: Slovenia
Online Status: Offline
Posts: 3
Posted: 21 June 2023 at 2:28pm | IP Logged Quote lukapor

Thx

Regards,
Luka
Back to Top View lukapor's Profile Search for other posts by lukapor
 

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