Solved

How to solve " BC30390" error?

Posted on 2002-07-29
5
948 Views
Last Modified: 2007-11-27
Good morning everybody,
I am trying to incorporation E-mail into my application. At the beginning of project, I already import System.Web.Mail Namespace, but when I compiled my project, it showed me this error: BC30390: 'System.Web.Mail.SmtpMail.Private Overloads Sub New()' is not accessible in this context because it is 'Private'.
 Dim MyMailConnection as new SmtpMail
How can I solve this problem?

Thank you very much,I am looking forward to your response.

0
Comment
Question by:lily66
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7185282
Smtp class does not have a public constructor. Therefore you are getting these compile errors. You can't instantiate a new object of this class. To use this class you don't reuire to create a new instance. Send method of this class is static or shared (in VB terms). You call it directly call it on class. HEre is a small sample from docs.

Dim from As String = "from@microsoft.com"
Dim mailto As String = "to@microsoft.com"
Dim subject As String = "UtilMailMessage001"
Dim body As String = "<html><body>UtilMailMessage001 - success</body></html>"
SmtpMail.Send(from, mailto, subject, body)
0
 

Author Comment

by:lily66
ID: 7185388
hi, naveenkahli
Thanks for your reply. I tried you code sample. It showed me this error as followings:
The "SendUsing" configuration value is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.

Source Error:

Line 38: Dim subject as string ="Welcome"
Line 39: Dim body as string ="<html><body>Welcome to be our new user, We hope you will enjoy your studying.</body></html>"
Line 40: SmtpMail.Send(from,mailto,subject,body)

Can you help me figure out what it means. I really appreciat your help.

Lily
 
0
 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
ID: 7185462
Try setting Smptp mail server as "localhost" or IP address of the machine that will have SMTP server hosted. If its your local machine, then set IP of your machine as SMTP server.
give it a shot
0
 

Author Comment

by:lily66
ID: 7186022
Hi, naveenkohli

I really appreciate you, right now it works properly.

lily
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7186039
I am glad i could help.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Definitions and default visual studio colors 5 58
Memory Usage 2 50
I need help assigning an image to an image control in my VB.Net WPF project 3 43
Connection String 16 43
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now