Hi All,
I am using VS2008, Asp.Net3.5, Win7.
How can set(configure) SMTP in Win7.
I am getting error (failure sending message) from smtpClient.Send(message).
I have doubt for smtp, i think i am not getting understand how to set smtp server.
so plz give me step by step idea for setting smtp server that's it work.
I am using this code below.
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress("mukeshpanth@gmail.com", "mukesh");
message.From = fromAddress;
message.To.Add("mukeshpanth@yahoo.com");
message.Subject = "Feedback";
message.CC.Add("mukeshpanth@gmail.com");
message.Bcc.Add(new MailAddress("mukesh061984@gmail.com"));
message.IsBodyHtml = false;
message.Body = @"Plain or HTML Text";
smtpClient.Send(message);
}
catch (Exception ex)
{
}
And I am using this code in web.config file.
host="localhost" port="25" in web.config file inside system.net tag
<system.net>
<mailsettings>
<smtp deliverymethod="Network">
<network host="localhost" port="25" defaultcredentials="true" />
</smtp>
</mailsettings>
</system.net>
help will be greatly appricated .......
Thanks
mukesh