Author |
|
loredano Newbie
Joined: 11 April 2018 Location: Italy
Online Status: Offline Posts: 15
|
Posted: 28 November 2018 at 1:00am | IP Logged
|
|
|
Hello.
We have a window service that from a csv and using a software of layout composition produce the data of the mail to send (bulk send) as PEC.
The data are: from,to (only one), body, object and one attachment; then it saves the data in a sqlserver database and save the eml in the folder.
We have many customer so the folder where the service saves the eml is different for every customer (i.e. account smtp). The state of these email in the database are TOSEND.
Another window service select all the records from the database of the email in the "TOSEND" state ad using the mailmerge (mail merge, mailer.AddJo, mailer.SendJobs) sends all the email. So the select on database to datatable for email merge take some time. After the service update the state of the mail in the database (from TOSEND to SENT).
My question is; we have already the eml produced by the first service so we can use this; we want select only the id of the email and the path of the eml (different for every customer/smtp) so the query is more fast and load the eml using the same process of your mailbequeue.
You think this procedure can be faster than the one we use now?
Best regards
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 28 November 2018 at 1:39am | IP Logged
|
|
|
Yes, looks like it can be faster.
Regards,
Alex
|
Back to Top |
|
|
loredano Newbie
Joined: 11 April 2018 Location: Italy
Online Status: Offline Posts: 15
|
Posted: 30 November 2018 at 6:04am | IP Logged
|
|
|
In this case, so i read the list (Ienumerable) of email to send and for each element in the collection i use:
mailer.AddJob("IdEmail", PathEml, true, null}
At the end can i retrieve the mail not sent as in mailmerge procedure (from the JobsFailed) or I have to use the handler SmtpMessageNotSentEventHandler as in mailbequeue? I want update the state of the mail in the collection in a transaction not one by one and have more task (each for every customer smtp).
Thanks
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 03 December 2018 at 3:02am | IP Logged
|
|
|
I believe both methods will work.
Regards,
Alex
|
Back to Top |
|
|