System.Web.Mail

i'm very new in vb.net and using web developer 2005 express edition.

i'll try to bulit one application which it can send mail.
i had read so many discussions about email and try to implement in my sourcecode but problem with system.web.mail.i did'nt know where to add the System.Web.Mail in reference .
[331 byte] By [passwordguru] at [2007-11-20 0:35:20]
# 1 Re: System.Web.Mail
If you are using 2005 then you have to use System.Net.Mail and not System.Web.Mail. You don't have to add any extra references just write this in the top of your module/form Imports System.Net.Mail Just take a look at your code editor and you will see that there are Imports Statements on the top of your module. This line will also be written there.
Shuja Ali at 2007-11-10 3:12:46 >
# 2 Re: System.Web.Mail
http://msdn2.microsoft.com/en-us/library/dk1fb84h.aspx
HanneSThEGreaT at 2007-11-10 3:13:50 >
# 3 Re: System.Web.Mail
Below is my failed sourcecode:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1_click" runat="server">LinkButton</asp:LinkButton></div>
</form>
</body>
</html>

p/s:HTML CODE FOR CALLING SUB OF LINKBUTTON1_CLICK
'------------------------
Imports System.Net.Mail

Private Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click

Dim email As New System.Net.Mail.MailMessage()
email.To = "test@yahoo.com"
email.From = "try@yahoo.com"
email.Body = "test"
email.Subject = "test"
System.Net.Mail.SmtpMail.SmtpServer = "mail.yahoo.com"
System.Net.Mail.SmtpMail.Send(email)

End Sub
passwordguru at 2007-11-10 3:14:46 >
# 4 Re: System.Web.Mail
I have never tried using it with other mail clients except for the default exchange server. Although from what I can see in the posted code is that you are not sending the User ID and Password for authentication. Wihtout authentication you will not be able to send an email. Take a look at this article which uses GMAIL in both .NET 1.1 & 2.0.
http://www.codeproject.com/useritems/SendMailUsingGmailAccount.asp

Although it is a C# code, you should be able to understand how to do the authentication part.
Shuja Ali at 2007-11-10 3:15:51 >
# 5 Re: System.Web.Mail
Tq. at last my codes succeed to send mail.

Do you have any articles about email the link documents.
passwordguru at 2007-11-10 3:16:51 >