?
Solved

SYSTEM NETMAIL

Posted on 2012-12-24
3
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 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