Hi,
Add this directive to the top of the page in code behind
Imports System.Net.Mail
Imports System.IO
Add this code to the Page_Load event of the page to send the mail
Dim credential as System.Net.NetworkCredential("youre windows live mailid","yourpassword")
Dim smtp as System.net.mail.SmtpClient
Dim mailobj as new MailMessage
maiobj.Subject="Yahoo"
mailobj.From= new MailAddress("your windows live id")
mailobj.To=new MailAddress("[email protected]")
mailobj.Body="Answers"
smtp.Host="mail.live.com"
smtp.Port=25
smtp.Credentials=credential
smtp.Send(mailObj)
If you have a windows live id use it else you need to create one. Else change the host property of the smpt object to the domain where yo have id like mail.google.com. Before that change the call to the NetworkCredential() constructor. Pass your gmail (in case of mail.google.com) id and password as parameter.
I have coded this for one of my projects and it worked then. I dont have the code with me now. This is all that I remember now and it should work fine.
HAPPY CODING
Sujit
Add this directive to the top of the page in code behind
Imports System.Net.Mail
Imports System.IO
Add this code to the Page_Load event of the page to send the mail
Dim credential as System.Net.NetworkCredential("youre windows live mailid","yourpassword")
Dim smtp as System.net.mail.SmtpClient
Dim mailobj as new MailMessage
maiobj.Subject="Yahoo"
mailobj.From= new MailAddress("your windows live id")
mailobj.To=new MailAddress("[email protected]")
mailobj.Body="Answers"
smtp.Host="mail.live.com"
smtp.Port=25
smtp.Credentials=credential
smtp.Send(mailObj)
If you have a windows live id use it else you need to create one. Else change the host property of the smpt object to the domain where yo have id like mail.google.com. Before that change the call to the NetworkCredential() constructor. Pass your gmail (in case of mail.google.com) id and password as parameter.
I have coded this for one of my projects and it worked then. I dont have the code with me now. This is all that I remember now and it should work fine.
HAPPY CODING
Sujit