I have this code to send mail:
public bool SendMail(MailMessage message)
{
message.From = new MailAddress(AppProperties.FromMailAddress, AppProperties.FromDisplayName);
SmtpClient smtp = new SmtpClient { EnableSsl = AppProperties.EnableSsl };
try
{
smtp.Send(message);
return true;
}
catch (Exception)
{
return false;
}
}
and have configured web.config to send mail using IIS 5.1 in localhost with this (as suggested by the answers):
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="localhost"
userName=""
password=""
defaultCredentials="false"
port="25" />
</smtp>
</mailSettings>
</system.net>
What do I have to do to send mail with my IIS 5.1 in Windows XP? Is possible to do it? I guess yes, as you say, since I don't get any exception, but I don't receive it on destination. If I should put an user and a password, wich must be?
Thanks in advanced.