Solved

How to solve " BC30390" error?

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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