SMTP Authentication

I have been using the standard .net SmtpClient class successfully for the past few years but am migrating my code to Aspose.Network. I am having difficulty even connecting to the SmtpHost.


With the standard smtp client I used the following code:

SmtpClient client = new SmtpClient();
client.Host = “hostname”;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;
client.Send(mailMessage);

With the Aspose SmtpClient how do I use the user’s DefaultCredentials?

Hi,


Thank you for inquiry.

Could you please try adding the following statement?
client.AuthenticationMethod = SmtpAuthentication.Login;

You may need to specify the host, port, username and password for connecting to an smtp server as mentioned at http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/sending-emails.html.

Thanks for your reply but perhaps I did not fully explain my problem: I wish to send an email using the logged on users credentials. I should not need to prompt them for a username/password if they are currently logged on to a windows domain.

With the standard .net smtpclient I specify this by setting UseDefaultCredentials=true.

From your response I assume that this is not possible using the Aspose class - is this correct?

Hi,


I am sorry, I did not checked using the default credentials with Aspose.Network’s SmtpClient class. I will get back to you on this with some more information after consulting with the developers.

Could you please also tell which email server and authentication settings you are using with .NET’s SmtpClient class, so that I could also check at my end.

Hi


I am attempting to connect to an exchange server 2007 (using smtp, port 25).

I am not specifying a username or password as I hoped to use the logged in user’s credentials.

I have tried all options for the authentication enum.


Regards
David

Hi,


I realize this discussion is a few years old, but I’m having the same issue trying to pass my application pool (DefaultCredentials) to the SMTP server for authentication. For security reasons, we don’t want to include the username/password within our website application but rather allow the Windows credentials used by the Application Pool to be sent through directly.

The built-in .Net smtp client allows the credentials to be passed directly, but I haven’t found an option with the Aspose smtp client to do this.

We are currently planning to replace our .Net smtp client with Aspose, but this could cause large issues if we need to change the authentication structure.

Thank you,

Claire

Hi Claire,

Thank you for writing to us.


At present, Aspose.Email doesn’t support using DefaultCredentials with SmtpClient. An investigation ticket with id: NETWORKNET-33872
has been logged in our issue tracking system for further consideration
of this issue by the development team. I have also linked this thread
with the logged ticket so as you get notified automatically once there
is any information available in this regard.

The issues you have found earlier (filed as NETWORKNET-33872) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.