Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > SendMailInternal vs SendMailAsynchronously View modes: 
User avatar
Member
Member
sh_dev - 5/3/2013 4:15:06 PM
   
SendMailInternal vs SendMailAsynchronously
Hi. is there a way to set the application to use SendEmailInternal vs using SendEmailAsyncInternal? I am using your sample code on using a third party email handler
(http://devnet.kentico.com/docs/devguide/index.html?custom_e-mail_provider.htm)
and the mail keeps hitting the async method.

User avatar
Member
Member
sh_dev - 5/3/2013 5:18:36 PM
   
RE:SendMailInternal vs SendMailAsynchronously
one other issue I am having is actually clearing the messages from the E-mail queue in the dashboard. I keep getting the SMTP host is not found error which makes sense since I am using a third party mail service. How can I get these to display correctly?

      protected override void SendEmailAsyncInternal(string siteName, MailMessage message, SMTPServerInfo smtpServer, EmailToken emailToken)
{
int response;
string detail;
try
{
var msg = new Mailer();
msg.SendGenericEmail(message.From.Address, message.To[0].Address, message.Subject, message.Body, true);
detail = string.Format("E-mail from {0} through {1} was dispatched (asynchronously)", message.From.Address, smtpServer.ServerName);
}
catch (Exception ex)
{
detail = string.Format("E-mail from {0} through {1}failed : {2} (asynchronously)", message.From.Address, smtpServer.ServerName, ex.Message);
}
EventLogProvider.LogInformation("CMSCustom", "Custom Asynch Mail Status", detail);

// base.SendEmailAsyncInternal(siteName, message, smtpServer, emailToken);

}

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 5/14/2013 5:07:34 AM
   
RE:SendMailInternal vs SendMailAsynchronously
Hi,

I believe that the solution provided by Sandro in co-operation with our consultants in the tickets was acceptable for you because we didn't get any response from you anymore.

Best regards,
Martin Danko