We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bulksend not working yet

Hello,


I modified the code to send the email message generated by the aspose template engine also utilizing System.Net.Mail’s SmptpClient and MailMessage since I have not managed to have aspose bulksend working to emails accounts outside the corporation. System.Net.Mail works for both corporation and outside customer emails, but Aspose does not work for outside customer emaisl which is what I need. With Aspose I get the attached Symantec screen after waiting for along time

Here is the code:

TemplateEngine engine = new TemplateEngine(msg);

engine.RegisterRoutine(“GetSignature”, new TemplateRoutine(GetSignature));

MailMessageCollection messages;

try
{
messages = engine.Instantiate(confirmationEmailTable);

MailMessage msg1 = engine.Merge(confirmationEmailTable[0]);

AsposeSingleton.instance.Client.BulkSend(messages);

System.Net.Mail.SmtpClient dotNetClient = new System.Net.Mail.SmtpClient(“SMTP.co…”, 25);
System.Net.Mail.MailMessage dotNetMessage = new System.Net.Mail.MailMessage();
dotNetMessage.Subject = msg1.Subject;
dotNetMessage.Body = msg1.HtmlBody;
dotNetMessage.IsBodyHtml = true;
dotNetMessage.From = new System.Net.Mail.MailAddress(msg1.From.ToString());
dotNetMessage.ReplyToList.Add(msg1.From.ToString());
dotNetMessage.To.Add(msg1.To[0].ToString());
dotNetClient.Send(dotNetMessage);
}
catch (MailException mex)
{
System.Diagnostics.Debug.WriteLine(mex.ToString());
}

1. It will be really good if I get the Aspose to work. This is only sending one email but I need to lots of customized emails templated different for each customer. Any Ideas?

2. I was wondering if it is okay to keep the Aspose SMTPClient instance in a singleton class or should I open and dispose the instance maybe utilizing a Using statement every time I need it? Righ tnow I am just refereing to the singleton.Instance always instantiated. What is the preferredway? I have not seen using statements on your examples either?

3. Also the validation returns a false MailServerValidationError when utilizing customer emails , it works fine when utilizing corporation emais but I have no use for that. I need the customer accounts to validate properly.
Aspose.Email.Verify.EmailValidator ev = new Aspose.Email.Verify.EmailValidator();
Aspose.Email.Verify.ValidationResult result;
try
{
ev.Validate(pBasicProfile.TestEmailAddress, out result);

It always result MailSeverValidationError for any valid customer email. It only passes if the emails are corporation emails which is not relevant in this project.



Hello Muhammad,


I will try tomorrow by creating the SMTPClient for each request instead of using a singleton instance. But in the mean time it will be great if you could answer the questions above?

Thanks

Luis

Hi Luis,


Thank you for posting your inquiry.

1. We have tested the bulk sending of emails generated from Template Engine and it works. Can you verify if you are behind some company wide firewall or DNS settings that is not allowing to send emails out of the network? Please share the SMTP Log of your test application and share that with us. Please make sure that you are using the latest version of the API at your end. Please also try your sample at your end on a different PC and share your feedback with us if you get on the other PC as well?

2. The SmptClient once initiated in application remains alive during the session and we haven’t faced any issue while using such a single client of the API and it works fine. So, you can use it in a singleton for your requirements.

3. It may be some issue with DNS or network settings at your end they may be stopping the EmailValidator to validate the external email addresses. It seems that this is linked with the point 1 above and we may get more information about it once the log file is provided.

Also, please try disabling the Internet Security/AntiVirus software at your end and share your feedback with us whether it works or not.

Hello Muhammad,


I will try tomorrow by creating the SMTPClient for each request instead of using a singleton instance. But in the mean time it will be great if you could answer the questions above?

4. Also if i add the header to the Aspose message template then the msg1.HTmlBody becomes empty even for in house email accounts, same thing for customer’s email accounts.

I realize you want more information and i am working on that. i know this government entity has two Exchange Servers one is 2010 and the other is 2013, the DotNetSMTPClient that worked in the code above was configured with port 25. I placed a ticket with our IT support group to figure out more details we need to figure this one out. I just wish that aspose was able to elaborate more on the exceptions (more details) without having to look into more things outside the code.

5. Also you mention the SMTP logs where are those located? I will attempt to look at them

Thanks again for all your help

Luis

Thanks Muhammed,


Like I mentioned before this is a large corporation with different departments in different buildings and locations in town. Firewall policies, Exchange server policies and antivirus policies can not be changed easily at all. But like I mentioned before the System.Net.Mail.SMPTClient is working fine (perfectly actually), I guess the question could be how-come it works with the System.Net.SMTPClient and it does not with aspose SMTPClient? I am pretty sure it is something small in the case of Aspose, It all points mostly to configuration I imagine, what else could be different in such a simple example as the one mentioned above? Again in there the bulkSend simply does not do anything and after more than 5 minutes I get the Symantec message attached.

Hopefully tomorrow I will have more information for you

thanks again
Luis



Hi Luis,

We understand that there might be some issue with the Aspose API that we need to reproduce at our end first before forwarding to our Product team.

4. Please follow this issue [here](https://forum.aspose.com/t/23363). It is always good to create a new thread and report each problem separately in a new thread so that the issues don’t mix up.

5.a. Please follow the link shared above for creating a sample application. When you will run this Windows Form based application, it will generate a log file. Once you hit the exception, please share the log file with us so that we can investigate the issue further and share our feedback with you.

5.b. Please add the code for bypassing the Exchange Server Certificate and see if it helps. This should be added to the start of the application.

Also, is it possible for you to:

  1. Test this issue from a different PC and share with us if it works or not?
  2. Please share the .NET Framework, OS & Visual Studio application information with us.
  3. If possible, please create a test account on your server and share those with us. We shall try to use these for reproducing the issue at our end and assist you further.

Got the Symantec issue resolved by setting security to auto


Hi Luis,


We are glad to know that your issues with Symantec settings are resolved. This will allow you to further explore the capabilities of our API. In case you face any issue, please feel free to write to us for further assistance.