Solved

SYSTEM NETMAIL

Posted on 2012-12-24
3
283 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 75

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 75

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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