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

Free Support Forum - aspose.com

Sending bulk emails by using ssl enabled smtp settings using bulk agent

Hi
I tried this code for sending bulk email, but an exception is coming while sending it states "At leat one E-mail message failed to deliver"
I had done this code:
MailMessage template = CreateMessage();


TemplateEngine engine = new TemplateEngine(template);
if (General.SelectedSignature > -1)
{
engine.RegisterRoutine(“GetSignature”, new Aspose.Network.Mail.TemplateRoutine(GetSignature));
}
InitializeDt();// filling the data table with values

MailMessageCollection messages = engine.Instantiate(dt); // where dt is data table.
//changed
SmtpClient client = new SmtpClient();
client.Host = smtp.gmail.com
client.Username = sajeesh@gmail.com;
client.Password = *******;
client.Port = 587;
client.SecurityMode = SmtpSslSecurityMode.Explicit;
client.EnableSsl = true;
try
{
client.BulkSend(messages);
MessageBox.Show(“done”);

}

I filled the mail message collection by using a data table…

can you please send me the code for sending bulk emails using ssl enabled smtp server settings using bulk agent method.
Regards,
sajeesh,

Hello,

It looks like some of the the messages are sent completed. Could you please check about the detail exception information?

Thanks

Hai,
when i try this code no emails are sending…and exception is coming…
Can u please send to me a solution for this
Regards,
Sajeesh

Hai,
This is the details of the exception when using the code:
MailMessage template = CreateMessage();


TemplateEngine engine = new TemplateEngine(template);
if (General.SelectedSignature > -1)
{
engine.RegisterRoutine(“GetSignature”, new Aspose.Network.Mail.TemplateRoutine(GetSignature));
}
InitializeDt();// filling the data table with values

MailMessageCollection messages = engine.Instantiate(dt); // where dt is data table.
//changed
SmtpClient client = new SmtpClient();
client.Host = smtp.gmail.com;
client.Username = sajeesh@gmail.com;
client.Password = *******;
client.Port = 587;
client.SecurityMode = SmtpSslSecurityMode.Explicit;
client.EnableSsl = true;
try
{
client.BulkSend(messages);
MessageBox.Show(“done”);

}

Aspose.Network.Mail.SmtpFailedBulkSendException was caught
Message=“At least one E-mail Message failed to deliver.”
Source=“Aspose.Network”
StackTrace:
at Aspose.Network.Mail.SmtpClientBulkSendAgent.xff4c5588fa5a5de3()
at Aspose.Network.Mail.SmtpClient.BulkSend(MailMessageCollection messages)
at My_Project.UserControls.MyCntrlSend.SendMail() in C:\My projects\My_Project\UserControls\MyCntrlSend.cs:line 1362


Hello,

Please send me all of the code. Like the CreateMessage. So that I can reproduce the bug locally. I will get back to you ASAP.

Thanks