|
 |
aspx thread: System.Web.Mail.SmtpMail problems
Message #1 by "Colin Styles" <stylesie1@y...> on Wed, 27 Feb 2002 23:20:57
|
|
When compiling a modified variation of the IBuySpy Store Components (VB
Framework version) I get the following error:
D:\InetPub\StoreVB\StoreVB\Components>vbc /t:library /out:..\bin\StoreVB.dl
l /r:System.dll /r:System.Web.dll /r:System.Xml.dll /r:System.Data.dll
CustomersDB.vb ProductsDB.vb OrdersDB.vb ReviewsDB.vb ShoppingCartDB.vb
EmailDB.vb
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
D:\InetPub\StoreVB\StoreVB\Components\EmailDB.vb(50) : error
BC30390: 'System.Web.Mail.SmtpMail.Private Overloads Sub New()' is not
accessible in this context because it is 'Private'.
Dim myMailConnection As SmtpMail = New SmtpMail
~~~~~~~~~~~~
I have "Imports System.Web.Mail" at the top of the "EmailDB.vb" file.
I have CDOSYS.DLL installed and registered on the server.
Anyone know whats going on here?
Thanks in advance for any help.
,-._|\ Colin Styles.
/ YGLU \ Yoogalu PTY LTD
\_,--._/ PHONE 612 9201 6408
v FAX 612 9201 6231
Message #2 by "Minh T. Nguyen" <nguyentriminh@y...> on Wed, 27 Feb 2002 15:40:14 -0800
|
|
Colin,
SnmtpMail is an abstract class (or whatever this concept is
being called now in .NET). You can't instantiate that class. You don't
need to, though. All you need to do is to access its static properties
and methods like this:
SmtpMail.SmtpServer = "smtp.mail.yahoo.com"
Then, in order to send mail you just instantiate a MailMessage
classes as in:
Dim MailMessage MyEmail = new MailMessage
MyEmail.From = "nguyentriminh@y..."
MyEmail.To = "aspx@p..."
MyEmail.Subject = "Hello World"
MyEmail.Body = "I hope it works"
SmtpMail.Send MyEmail
Hope it helps,
Minh.
-----Original Message-----
From: Colin Styles [mailto:stylesie1@y...]
Sent: Wednesday, February 27, 2002 11:21 PM
To: ASP+
Subject: [aspx] System.Web.Mail.SmtpMail problems
When compiling a modified variation of the IBuySpy Store Components (VB
Framework version) I get the following error:
D:\InetPub\StoreVB\StoreVB\Components>vbc /t:library
/out:..\bin\StoreVB.dl l /r:System.dll /r:System.Web.dll
/r:System.Xml.dll /r:System.Data.dll
CustomersDB.vb ProductsDB.vb OrdersDB.vb ReviewsDB.vb ShoppingCartDB.vb
EmailDB.vb
Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
D:\InetPub\StoreVB\StoreVB\Components\EmailDB.vb(50) : error
BC30390: 'System.Web.Mail.SmtpMail.Private Overloads Sub New()' is not
accessible in this context because it is 'Private'.
Dim myMailConnection As SmtpMail = New SmtpMail
~~~~~~~~~~~~
I have "Imports System.Web.Mail" at the top of the "EmailDB.vb" file.
I have CDOSYS.DLL installed and registered on the server.
Anyone know whats going on here?
Thanks in advance for any help.
,-._|\ Colin Styles.
/ YGLU \ Yoogalu PTY LTD
\_,--._/ PHONE 612 9201 6408
v FAX 612 9201 6231
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Message #3 by "Colin Styles" <stylesie1@y...> on Thu, 28 Feb 2002 00:11:47
|
|
Thank you Minh It worked perfectly. You are a legend :-)
When you look at the error message, in hind-sight, it's still very obscure.
|
|
 |