Hi Aspose,
Inside our company we uses a SMTP server that can use without longing to the server. Simple it will send out what ever the emails, If it sent to port 25 of the server.
So how can use Aspose SMTP to send out email using this server?
Hi Aspose,
Hi Nayana,
Thank you for putting your inquiry to us.
As far as I understand, you are talking about sending emails using Default Credentials where the logged in user’s name and password is used for sending the email using SMTP. In such case, you can set the “UseDefaultCredentials” flag of StmpClient and send the email as shown in the following sample code. Please let us know if you need further assistance in this regard.
Sample Code:
using (SmtpClient smtpClient = new SmtpClient(server.SmtpUrl, server.SmtpPort))
{
smtpClient.EnableSsl = server.SmtpEnableSsl;
smtpClient.SecurityMode = server.SmtpSecurityMode;
smtpClient.UseDefaultCredentials = true; // <<< !!!!!!!!!!!!!!!!!!!!!
MailMessage mm = new MailMessage(
server.User1.EMail,
server.User1.EMail,
"NETWORKNET-33872 - " + Guid.NewGuid().ToString(),
"NETWORKNET-33872 Smtp Authentication using DefaultCredentials");
smtpClient.Send(mm);
}