Solved

How to solve " BC30390" error?

Posted on 2002-07-29
5
966 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…

685 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