Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: MailMessage Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
adam.kozovo
Newbie
Newbie


Joined: 30 June 2023
Online Status: Offline
Posts: 19
Posted: 16 July 2023 at 3:18am | IP Logged Quote adam.kozovo

Hello
Before calling:
.Attachments.Add
.To.Add
to add to attachments/to collections, is there any method/property to check the existence or duplicate add preventing?
Thank you
Back to Top View adam.kozovo's Profile Search for other posts by adam.kozovo
 
adam.kozovo
Newbie
Newbie


Joined: 30 June 2023
Online Status: Offline
Posts: 19
Posted: 16 July 2023 at 3:24am | IP Logged Quote adam.kozovo

For attachments:

For Each Attach As Attachment In AttachmentCollection
If String.IsNullOrWhiteSpace(Attach.FilenameOriginal) = False Then
    outFileName = Attach.FilenameOriginal
ElseIf String.IsNullOrWhiteSpace(Attach.Filename) = False Then
    outFileName = Attach.Filename
ElseIf String.IsNullOrWhiteSpace(Attach.Name) = False Then
    outFileName = Attach.Name
End If
If outFileName = AttachmentName Then Return True

First I didnít know to be on a safe side, which name property should be checked

Second was not sure if thereís a method/property to check existence or duplicate add preventing?
Back to Top View adam.kozovo's Profile Search for other posts by adam.kozovo
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2205
Posted: 20 July 2023 at 6:17am | IP Logged Quote Alex

Hi, there is no such property. And attachments are not filesystem. Two attachments can have the same names and filenames and be different. That's normal and happens all the time.

If you just want to make sure the user, like, doesn't add the same attachment twice, you can use external code for that (like store some list of full filenames with paths of files which have already been added as attachment), i.e. don't rely on MailBee for that.

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

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