I am following a book and I used this code and get the error in the subject line.
<%@ Page Language="VB" Debug="True" %>
<html>
<head>
<title>Untitled Document</title>
<body>
<%
Dim EMailFrom As String = "bill@edgequest.com"
Dim EMailTo As String = "grantb@omnigraphix.com"
Dim EMailSubject As String = "Important Message!"
Dim EMailBody As String = "Thanks for reading this " & "message but I must admit, I lied. There's " & "nothing important about this message at all."
Dim MySmtpClient As New System.Net.Mail.StmpClient("localhost")
MyStmpClient.Send(EmailFrom, EmailTo, EmailSubject, EmailBody)
%>
</body>
</html>
What am I doing wrong?
<%@ Page Language="VB" Debug="True" %>
<html>
<head>
<title>Untitled Document</title>
<body>
<%
Dim EMailFrom As String = "bill@edgequest.com"
Dim EMailTo As String = "grantb@omnigraphix.com"
Dim EMailSubject As String = "Important Message!"
Dim EMailBody As String = "Thanks for reading this " & "message but I must admit, I lied. There's " & "nothing important about this message at all."
Dim MySmtpClient As New System.Net.Mail.StmpClient("localhost")
MyStmpClient.Send(EmailFrom, EmailTo, EmailSubject, EmailBody)
%>
</body>
</html>
What am I doing wrong?
-
Re: BC30002: Type 'System.Net.Mail.StmpClient' is not defined.
Tue, March 21, 2006 - 8:21 AMYou have a typo: its spelled: SmtpClient
Assuming that you are programming against version 2.0 of the .net framework (in 1.1 the smptClient lives in a different namespace) then it should work ok.
-
Re: BC30002: Type 'System.Net.Mail.StmpClient' is not defined.
Tue, March 21, 2006 - 9:02 AMwww.systemwebmail.net has better samples to start from
1.1
www.systemnetmail.com/
2.0
These sites will not only have working samples but have all your troubleshootinsg tips and tricks.