Solved

SYSTEM NETMAIL

Posted on 2012-12-24
3
278 Views
Last Modified: 2012-12-24
The following code was being utilized with a form for which after submittal it would send out an e-mail.   I recently changed host services and now it appears that I need to incorperate the host server credentials ie "Name and Password" to function.   Referencing the code below I am gettting a line error @ (SmtpClient.Credentials) stating an object reference is required or property 'System.NetMail.Smtp.Client.Credentials.get'


        AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlBody, null, "text/html");
        message.AlternateViews.Add(plainView);
        message.AlternateViews.Add(htmlView);
        message.Priority = MailPriority.High;
        smtpClient.Host = "server.net ";
        SmtpClient.Credentials = new NetworkCredential("support@namannassar.com", "passcode");
        smtpClient.Send(message);
0
Comment
Question by:BOEING39
  • 2
3 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38719141
Change the capital "S" to a lowercase "s":

smtpClient.Credentials = new NetworkCredential("support@namannassar.com", "passcode");

Open in new window

0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 38719145
P.S.

It is situations like this where it is highly advisable to not name your variables the same name as the class you are instantiating (save for a change of casing). Subtle errors like these can crop up, and--depending on the scenario--could be much more harmful.
0
 

Author Closing Comment

by:BOEING39
ID: 38719151
Thx for the quick response
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

13 Experts available now in Live!

Get 1:1 Help Now