Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: duplicate Attachments Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
talaattito
Groupie
Groupie
Avatar

Joined: 05 October 2011
Location: Egypt
Online Status: Offline
Posts: 44
Posted: 15 October 2012 at 6:06am | IP Logged Quote talaattito

please im used mailbee 7 and .net
when i send email to multiple recipients and use this line of code
==>> mailer.Message.ImportRelatedFiles(ImportRelatedFilesOptions.ImportFromUris)
i find that import related files duplicated depend on numbers of recipients
there is way to import related files only one time to all recipients and dont duplicate it
---im clear attachments for every message but this way take long time becouse in each time it import related files
i hope you understand me
thank you
Back to Top View talaattito's Profile Search for other posts by talaattito
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 October 2012 at 3:30am | IP Logged Quote Igor

I have tried reproducing the problem with the latest DLL build, the HTML file I used was extremely minimal:

Code:
<html><head><title>Import Test</title></head><body>
<img src="http://www.afterlogic.com/files/oe.png">
</body></html>


and the code I used is as follows:

Code:
Smtp mailer = new Smtp();
mailer.SmtpServers.Add("mail.domain.com", "user@domain.com", "password");
mailer.Message.LoadBodyText(@"C:\test\img.html", MessageBodyType.Html, System.Text.Encoding.Default, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris);
mailer.Subject = "Import Test";
mailer.From.AsString = "user@domain.com";
mailer.To.AddFromString("user@domain.com");
mailer.Cc.AddFromString("admin@domain.com");
mailer.Send();


Duplication is not confirmed. If you have any idea how the above sample should be modified to replicate the problem, please let us know.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
talaattito
Groupie
Groupie
Avatar

Joined: 05 October 2011
Location: Egypt
Online Status: Offline
Posts: 44
Posted: 16 October 2012 at 5:51am | IP Logged Quote talaattito

sorry i mean if i send bulk of mails
i used for loop to send emails
this is for loop code
=====================================================
For SendEmails.i = 1 To ToMails.Count
    AddEmailAsJob(mailer)
Next i
mailer.SendJobs()
Sub AddEmailAsJob(ByVal mailer As Smtp)
        Try
            Dim f As Integer
            Dim s As String = i.ToString("0000000") '1 -> "0000001".
            mailer.Message.From.AsString = "im@yahoo.com"
            mailer.Message.ReplyTo.AsString = "im@yahoo.com"
            mailer.Message.To.AsString = "to@yahoo.com"
            mailer.Message.Priority = MailPriority.Highest
            mailer.Message.Subject = "subject"
            mailer.Message.Charset = "utf-8"
            mailer.Message.BodyHtmlText = "BodyMail"
            mailer.Message.ImportRelatedFiles (ImportRelatedFilesOptions.ImportFromUris)
            mailer.AddJob(s, Nothing, Nothing)
End Sub
========================================
in this case if i send 3 mails ImportRelatedFiles duplicate 3 times
there is way to ImportRelatedFiles on the first time only for all mails
thank you
Back to Top View talaattito's Profile Search for other posts by talaattito
 
talaattito
Groupie
Groupie
Avatar

Joined: 05 October 2011
Location: Egypt
Online Status: Offline
Posts: 44
Posted: 16 October 2012 at 5:56am | IP Logged Quote talaattito

talaattito wrote:
sorry i mean if i send bulk of mails
i used for loop to send emails
this is for loop code
=====================================================
For SendEmails.i = 1 To ToMails.Count
    AddEmailAsJob(mailer)
Next i
mailer.SendJobs()
Sub AddEmailAsJob(ByVal mailer As Smtp)
            Dim f As Integer
            Dim s As String = i.ToString("0000000") '1 -> "0000001".
            mailer.Message.From.AsString = "im@yahoo.com"
            mailer.Message.ReplyTo.AsString = "im@yahoo.com"
            mailer.Message.To.AsString = "to@yahoo.com"
            mailer.Message.Priority = MailPriority.Highest
            mailer.Message.Subject = "subject"
            mailer.Message.Charset = "utf-8"
            mailer.Message.BodyHtmlText = "BodyMail"
            mailer.Message.ImportRelatedFiles (ImportRelatedFilesOptions.ImportFromUris)
            mailer.AddJob(s, Nothing, Nothing)
End Sub
========================================
in this case if i send 3 mails ImportRelatedFiles duplicate 3 times
there is way to ImportRelatedFiles on the first time only for all mails
thank you
Back to Top View talaattito's Profile Search for other posts by talaattito
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 October 2012 at 5:57am | IP Logged Quote Igor

Not sure why you'd need to import files in the loop, I'd suggest to do that outside of the loop. If that, however, is absolutely necessary for some reason, you can either clear attachments collection or reset the message itself.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
talaattito
Groupie
Groupie
Avatar

Joined: 05 October 2011
Location: Egypt
Online Status: Offline
Posts: 44
Posted: 16 October 2012 at 6:09am | IP Logged Quote talaattito

if i do that outside the loop the import files not attached in email
please where i place the code of import files outside loop
give me sample please, i wait you
thank you
Back to Top View talaattito's Profile Search for other posts by talaattito
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 October 2012 at 6:18am | IP Logged Quote Igor

Oh, I missed the point that you use SendJobs there, not a regular loop. And in that case, using Attachments.Clear or Message.Reset methods are the only option, especially if there are different files for different recipients.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Shakhawat
Newbie
Newbie


Joined: 01 November 2012
Location: United States
Online Status: Offline
Posts: 1
Posted: 01 November 2012 at 4:21am | IP Logged Quote Shakhawat

Can you help me to open a Hotmail account. How to open it?
Back to Top View Shakhawat's Profile Search for other posts by Shakhawat Visit Shakhawat's Homepage
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 01 November 2012 at 4:30am | IP Logged Quote Igor

Depends on what exactly you mean by "open an account". If you need to access your hotmail / live.com account via POP3 or SMTP with MailBee.NET Objects, supply pop3.live.com or smtp.live.com respectively for mail server hostname, MailBee will automatically configure the port number and SSL/TLS settings.

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

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