Posted on: 5/26/2011 1:08:55 AM | Views : 699

Hello,
 
I am working in asp.net 2.0 framework. I need to send email using gmail or hotmail smtp server. But I always get smtp requires ssl.. But there is no way to put EnableSsl="true" in web.config(possible in .NET 4 but not in .NET 2). Infact I tried programatically enabling ssl. But that also not working.
so, is there any work around?
web.config:
<system.net> <mailSettings> <smtp deliveryMethod="Network" from="xxx@gmail.com"> <network host="smtp.gmail.com" password="xxxx" port="587" userName="xxxx@gmail.com" /> </smtp> </mailSettings> </system.net>
Code behind:

protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e) { SmtpClient cli = SmtpClient(); cli.EnableSsl = true; c ...

Go to the complete details ...